From a4c92d0559800c679129f5f4ca3035ee86d2cf4d Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 31 Mar 2015 06:32:18 +0000 Subject: 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 --- test/ruby/test_dir.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') 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 -- cgit v1.2.3