diff options
author | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 03:23:11 +0000 |
---|---|---|
committer | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 03:23:11 +0000 |
commit | 81eb635f8cf9e2c25703cb9735dce012daa70ccc (patch) | |
tree | 4102ab5473041741ca442502b2d8231f170c4dca /test/minitest/metametameta.rb | |
parent | 304885cdffeba202de0e51425f76d92945a3b2a5 (diff) | |
download | ruby-81eb635f8cf9e2c25703cb9735dce012daa70ccc.tar.gz |
Imported minitest 4.3.2 (r8026)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/minitest/metametameta.rb')
-rw-r--r-- | test/minitest/metametameta.rb | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/test/minitest/metametameta.rb b/test/minitest/metametameta.rb index a4f7dfa1e6..65eece07ca 100644 --- a/test/minitest/metametameta.rb +++ b/test/minitest/metametameta.rb @@ -24,7 +24,9 @@ class MetaMetaMetaTestCase < MiniTest::Unit::TestCase EOM - @tu.run flags + with_output do + @tu.run flags + end output = @output.string.dup output.sub!(/Finished tests in .*/, "Finished tests in 0.00") @@ -49,14 +51,24 @@ class MetaMetaMetaTestCase < MiniTest::Unit::TestCase srand 42 MiniTest::Unit::TestCase.reset @tu = MiniTest::Unit.new - @output = StringIO.new("") + MiniTest::Unit.runner = nil # protect the outer runner from the inner tests - MiniTest::Unit.output = @output end def teardown super - MiniTest::Unit.output = $stdout - Object.send :remove_const, :ATestCase if defined? ATestCase + end + + def with_output + synchronize do + begin + @output = StringIO.new("") + MiniTest::Unit.output = @output + + yield + ensure + MiniTest::Unit.output = STDOUT + end + end end end |