1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_dir.rb: test_entries

* test/ruby/test_dir.rb (test_entries): test for Dir#entries.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-03-31 06:32:18 +00:00
parent 0313635cfd
commit a4c92d0559

View file

@ -178,6 +178,11 @@ class TestDir < Test::Unit::TestCase
end
end
def test_entries
entries = Dir.open(@root) {|dir| dir.entries}
assert_equal(%w(. ..) + (?a..?z).to_a, entries.sort)
end
def test_foreach
assert_equal(%w(. ..) + (?a..?z).to_a, Dir.foreach(@root).to_a.sort)
end