From f398d750ea3450762c0ba10c5dea4522d4676360 Mon Sep 17 00:00:00 2001 From: mame Date: Tue, 23 Sep 2008 00:03:42 +0000 Subject: * lib/pathname.rb (each_filename): return Enumerator if no block given. * test/pathname/test_pathname.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/pathname/test_pathname.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index 11c1bb7b2b..da12383bdd 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -481,6 +481,7 @@ class TestPathname < Test::Unit::TestCase result = [] Pathname.new("/usr/bin/ruby").each_filename {|f| result << f } assert_equal(%w[usr bin ruby], result) + assert_equal(%w[usr bin ruby], Pathname.new("/usr/bin/ruby").each_filename.to_a) end def test_kernel_pathname -- cgit v1.2.3