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

ruby-changes:34046

From: nobu <ko1@a...>
Date: Mon, 26 May 2014 12:42:33 +0900 (JST)
Subject: [ruby-changes:34046] nobu:r46127 (trunk): minitest/unit.rb: fix leaking tempfile

nobu	2014-05-26 12:42:27 +0900 (Mon, 26 May 2014)

  New Revision: 46127

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

  Log:
    minitest/unit.rb: fix leaking tempfile
    
    * test/lib/minitest/unit.rb (capture_subprocess_io): opened files
      can not be unlinked on Windows.

  Modified files:
    trunk/test/lib/minitest/unit.rb
Index: test/lib/minitest/unit.rb
===================================================================
--- test/lib/minitest/unit.rb	(revision 46126)
+++ test/lib/minitest/unit.rb	(revision 46127)
@@ -522,10 +522,10 @@ module MiniTest https://github.com/ruby/ruby/blob/trunk/test/lib/minitest/unit.rb#L522
 
           [captured_stdout.read, captured_stderr.read]
         ensure
-          captured_stdout.unlink
-          captured_stderr.unlink
           $stdout.reopen orig_stdout
           $stderr.reopen orig_stderr
+          captured_stdout.close!
+          captured_stderr.close!
         end
       end
     end

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

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