diff options
Diffstat (limited to 'test/pathname/test_pathname.rb')
-rw-r--r-- | test/pathname/test_pathname.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index 1efd40121d..d0c2aa18ca 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -1250,6 +1250,19 @@ class TestPathname < Test::Unit::TestCase assert_kind_of(Pathname, wd) end + def test_glob + with_tmpchdir('rubytest-pathname') {|dir| + Dir.mkdir("d") + open("d/f", "w") {|f| f.write "abc" } + Dir.mkdir("d/e") + assert_equal([Pathname("d/e"), Pathname("d/f")], Pathname("d").glob("*").sort) + a = [] + Pathname("d").glob("*") {|path| a << path } + a.sort! + assert_equal([Pathname("d/e"), Pathname("d/f")], a) + } + end + def test_entries with_tmpchdir('rubytest-pathname') {|dir| open("a", "w") {} |