summaryrefslogtreecommitdiff
path: root/test/pathname
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-19 12:52:37 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-19 12:52:37 +0000
commit54f282c2c4102e6b2d3c641054b3c08808788224 (patch)
tree4a2bae73b6c3118135083e95f0cb34d8de507dc0 /test/pathname
parent62fed7c91a7a38e0469bbd454d1c4e8c373e91e5 (diff)
* lib/pathname.rb (Pathname#find): return an enumerator if
no block is given. * test/pathname/test_pathname.rb: add tests for above. [ruby-dev:44797] [Feature #5572] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/pathname')
-rw-r--r--test/pathname/test_pathname.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index ac9b415022..401bad2d17 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -1235,6 +1235,10 @@ class TestPathname < Test::Unit::TestCase
assert_equal([Pathname("."), Pathname("a"), Pathname("b"), Pathname("d"), Pathname("d/x"), Pathname("d/y")], a)
a = []; Pathname("d").find {|v| a << v }; a.sort!
assert_equal([Pathname("d"), Pathname("d/x"), Pathname("d/y")], a)
+ a = Pathname(".").find.sort
+ assert_equal([Pathname("."), Pathname("a"), Pathname("b"), Pathname("d"), Pathname("d/x"), Pathname("d/y")], a)
+ a = Pathname("d").find.sort
+ assert_equal([Pathname("d"), Pathname("d/x"), Pathname("d/y")], a)
}
end