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:
parent
0313635cfd
commit
a4c92d0559
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue