summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-31 06:32:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-31 06:32:18 +0000
commita4c92d0559800c679129f5f4ca3035ee86d2cf4d (patch)
tree0191488c29e1cc980c3c1e7faed00d96a9ce9a5e /test
parent0313635cfd86a3d7b6b2f54a56237e0bd6f8c883 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_dir.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb
index 81e047d385..1f782fd7dd 100644
--- a/test/ruby/test_dir.rb
+++ b/test/ruby/test_dir.rb
@@ -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