summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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