diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-24 07:15:55 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-24 07:15:55 +0000 |
commit | 6a3a7e9114c3ede47d15f0d2a73f392cfcdd1ea7 (patch) | |
tree | 81666af8b33f71df8c624f4940df197a70cbc692 /test/ruby/test_dir.rb | |
parent | f7210deb82c57e736ee8e4db2ff43cba17cb5829 (diff) |
dir.c: Dir#each_child
* dir.c (dir_each_child_m): new instance methods Dir#each_child
and Dir#children. [Feature #13969]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_dir.rb')
-rw-r--r-- | test/ruby/test_dir.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb index cead4beb93..9a1a51ef51 100644 --- a/test/ruby/test_dir.rb +++ b/test/ruby/test_dir.rb @@ -232,14 +232,17 @@ class TestDir < Test::Unit::TestCase end def test_foreach + assert_entries(Dir.open(@root) {|dir| dir.each.to_a}) assert_entries(Dir.foreach(@root).to_a) end def test_children + assert_entries(Dir.open(@root) {|dir| dir.children}, true) assert_entries(Dir.children(@root), true) end def test_each_child + assert_entries(Dir.open(@root) {|dir| dir.each_child.to_a}, true) assert_entries(Dir.each_child(@root).to_a, true) end |