summaryrefslogtreecommitdiff
path: root/lib/test
diff options
context:
space:
mode:
authorsorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-03 11:48:47 +0000
committersorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-03 11:48:47 +0000
commitd1a7670bafb97ea31e16c2055ca846425d2bad69 (patch)
treeb3365d8cad806c4fd89d37197c21634cb4d475ea /lib/test
parent19c78f9b9bb86db1eb176181e4f444eaa781f348 (diff)
* lib/test/unit/parallel.rb: Keep $stdin, $stdout before run testcase
and restore after run. Because some test break $stdin, $stdout. Fixes [Bug #4433] [ruby-core:35353] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/test')
-rw-r--r--lib/test/unit/parallel.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/test/unit/parallel.rb b/lib/test/unit/parallel.rb
index c5d07e673b..deda1d1ef5 100644
--- a/lib/test/unit/parallel.rb
+++ b/lib/test/unit/parallel.rb
@@ -26,9 +26,11 @@ module Test
def _run_suite(suite, type)
r = report.dup
- orig_stdout = MiniTest::Unit.output
+ orig_testout = MiniTest::Unit.output
i,o = IO.pipe
+
MiniTest::Unit.output = o
+ orig_stdin, orig_stdout = $stdin, $stdout
th = Thread.new do
begin
@@ -49,7 +51,9 @@ module Test
result = [nil,nil]
end
- MiniTest::Unit.output = orig_stdout
+ MiniTest::Unit.output = orig_testout
+ $stdin = orig_stdin
+ $stdout = orig_stdout
o.close
begin
@@ -70,6 +74,8 @@ module Test
return result
ensure
MiniTest::Unit.output = orig_stdout
+ $stdin = orig_stdin
+ $stdout = orig_stdout
o.close if o && !o.closed?
i.close if i && !i.closed?
end