From bc242b4bc253a9b1a31cc633896a03f3974aeae9 Mon Sep 17 00:00:00 2001 From: Dana Sherson Date: Thu, 23 Nov 2023 22:55:58 +1300 Subject: [PATCH] fixup! fixup! GlobGitignore doesn't preprocess patterns --- spec/pattern_parser/glob_gitignore_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/pattern_parser/glob_gitignore_spec.rb b/spec/pattern_parser/glob_gitignore_spec.rb index e23f6e7..354f0d2 100644 --- a/spec/pattern_parser/glob_gitignore_spec.rb +++ b/spec/pattern_parser/glob_gitignore_spec.rb @@ -48,7 +48,11 @@ def build(pattern) it { expect(build('bar/../../../foo')).to be_like PathList::Matcher::ExactString.new('/foo', :ignore) } it { expect(build('bar/../../../../foo')).to be_like PathList::Matcher::ExactString.new('/foo', :ignore) } - it { expect(build('bar/**/../foo')).to be_like PathList::Matcher::ExactString.new('/a/path/bar/foo', :ignore) } + it do + expect(build('bar/**/../foo')) + .to be_like PathList::Matcher::ExactString.new('/a/path/bar/foo', :ignore) + end + it { expect(build('bar**/../foo')).to be_like PathList::Matcher::ExactString.new('/a/path/foo', :ignore) } it { expect(build('bar../foo')).to be_like PathList::Matcher::ExactString.new('/a/path/bar../foo', :ignore) } it { expect(build('bar/..foo')).to be_like PathList::Matcher::ExactString.new('/a/path/bar/..foo', :ignore) } @@ -355,7 +359,7 @@ def build(pattern) end describe 'leading ./ means current directory based on the root' do - it { expect(build('./foo')).to be_like PathList::Matcher::ExactString.new("/a/path/foo", :ignore) } + it { expect(build('./foo')).to be_like PathList::Matcher::ExactString.new('/a/path/foo', :ignore) } end describe 'A line starting with # serves as a comment.' do