Skip to content

Commit

Permalink
Add specs for nested braces in Dir.glob (@meadow)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Phoenix committed Mar 21, 2011
1 parent af538f1 commit 965ca2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/ruby/core/dir/fixtures/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ def self.mock_dir_files
subdir_two/nondotfile
subdir_two/nondotfile.ext

brace/a
brace/a.js
brace/a.erb
brace/a.js.rjs
brace/a.html.erb

Expand Down
5 changes: 5 additions & 0 deletions spec/ruby/core/dir/shared/glob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@
files.should == %w!brace/a.js.rjs brace/a.html.erb!
end

it "respects the optional nested {} expressions" do
files = Dir.send(@method, "brace/a{.{js,html},}{.{erb,rjs},}")
files.should == %w!brace/a.js.rjs brace/a.js brace/a.html.erb brace/a.erb brace/a!
end

it "matches special characters by escaping with a backslash with '\\<character>'" do
Dir.mkdir 'foo^bar'

Expand Down

0 comments on commit 965ca2f

Please sign in to comment.