Hi,

At Sat, 18 Oct 2008 10:50:04 +0900,
Tanaka Akira wrote in [ruby-core:19373]:
> The problem is caused by capture_io restores $stdout as
> dupped $stdout.

No chance to use reopen inside the block?


Index: lib/minitest/unit.rb =================================================================== --- lib/minitest/unit.rb (revision 19903) +++ lib/minitest/unit.rb (working copy) @@ -192,5 +192,6 @@ module MiniTest require 'stringio' - orig_stdout, orig_stderr = $stdout.dup, $stderr.dup + orig_stdout, orig_stderr = $stdout, $stderr + dup_stdout, dup_stderr = orig_stdout.dup, orig_stderr.dup captured_stdout, captured_stderr = StringIO.new, StringIO.new $stdout, $stderr = captured_stdout, captured_stderr @@ -200,4 +201,6 @@ module MiniTest return captured_stdout.string, captured_stderr.string ensure + orig_stdout.reopen(dup_stdout) + orig_stderr.reopen(dup_stderr) $stdout = orig_stdout $stderr = orig_stderr
-- Nobu Nakada