diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-03 06:18:43 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-03 06:18:43 +0000 |
commit | 2e9d4b9f0bd0cae89e75a7a16b2cf0c55aeb9c0e (patch) | |
tree | 79b6b33a51ad2fa4532d3255efd4c0736d2456fe /test | |
parent | 7ebea69529a15e6e3004aeafb40f7d469f47b37d (diff) | |
download | ruby-2e9d4b9f0bd0cae89e75a7a16b2cf0c55aeb9c0e.tar.gz |
do not close FSs explicitly.
* test/ruby/test_dir.rb: r67159 closes all files explicitly
but this change breaks attempt of this test introduced at
r56467. Try another solution which removes all references
from an Array with `#clear`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_dir.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb index 85197ca864..51ea8e95e0 100644 --- a/test/ruby/test_dir.rb +++ b/test/ruby/test_dir.rb @@ -458,10 +458,10 @@ class TestDir < Test::Unit::TestCase Process.setrlimit(Process::RLIMIT_NOFILE, 50) begin fs = [] - tap {tap {tap {(0..100).map {fs << open(IO::NULL)}}}} + tap {tap {tap {(0..100).each {fs << open(IO::NULL)}}}} rescue Errno::EMFILE ensure - fs.each{|f| f.close} + fs.clear end list = Dir.glob("*").sort assert_not_empty(list) |