Skip to content

Commit

Permalink
fixup! fixup! GlobGitignore doesn't preprocess patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
robotdana committed Nov 23, 2023
1 parent a706a72 commit bc242b4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec/pattern_parser/glob_gitignore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bc242b4

Please sign in to comment.