summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-29 13:12:38 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-29 13:12:38 +0000
commit2edc9ea5f8746a02ea55859e286096485200678f (patch)
treef56aad85747131c9e2530db18e1a2fc5f88be871
parenta2f9b00ad4871d3b0992212b89a2ecbe662e17b5 (diff)
test/logger/test_logdevice.rb: Close fds.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/logger/test_logdevice.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/logger/test_logdevice.rb b/test/logger/test_logdevice.rb
index 0f9fd179d98..78eb12e3c95 100644
--- a/test/logger/test_logdevice.rb
+++ b/test/logger/test_logdevice.rb
@@ -289,7 +289,8 @@ class TestLogDevice < Test::Unit::TestCase
end
def test_shifting_size_not_rotate_too_much
- d(@filename).__send__(:add_log_header, @tempfile)
+ logdev0 = d(@filename)
+ logdev0.__send__(:add_log_header, @tempfile)
header_size = @tempfile.size
message = "*" * 99 + "\n"
shift_size = header_size + message.size * 3 - 1
@@ -324,6 +325,8 @@ class TestLogDevice < Test::Unit::TestCase
logdev2.close if logdev2
end
end
+ ensure
+ logdev0.close
end unless /mswin|mingw/ =~ RUBY_PLATFORM
def test_shifting_midnight