[前][次][番号順一覧][スレッド一覧]

ruby-changes:34148

From: akr <ko1@a...>
Date: Thu, 29 May 2014 22:12:43 +0900 (JST)
Subject: [ruby-changes:34148] akr:r46229 (trunk): test/logger/test_logdevice.rb: Close fds.

akr	2014-05-29 22:12:38 +0900 (Thu, 29 May 2014)

  New Revision: 46229

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=46229&view=revision

  Log:
    test/logger/test_logdevice.rb: Close fds.

  Modified files:
    trunk/test/logger/test_logdevice.rb
Index: test/logger/test_logdevice.rb
===================================================================
--- test/logger/test_logdevice.rb	(revision 46228)
+++ test/logger/test_logdevice.rb	(revision 46229)
@@ -289,7 +289,8 @@ class TestLogDevice < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/logger/test_logdevice.rb#L289
   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::TestCa https://github.com/ruby/ruby/blob/trunk/test/logger/test_logdevice.rb#L325
         logdev2.close if logdev2
       end
     end
+  ensure
+    logdev0.close
   end unless /mswin|mingw/ =~ RUBY_PLATFORM
 
   def test_shifting_midnight

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]