mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Replace Test::Unit to Test::Unit::Runner migrated with MiniTest::Unit
This commit is contained in:
parent
6d206352c3
commit
ad979a5e00
Notes:
git
2021-09-11 08:48:34 +09:00
2 changed files with 9 additions and 9 deletions
|
@ -45,9 +45,9 @@ class MetaMetaMetaTestCase < Test::Unit::TestCase
|
|||
super
|
||||
srand 42
|
||||
Test::Unit::TestCase.reset
|
||||
@tu = Test::Unit.new
|
||||
@tu = Test::Unit::Runner.new
|
||||
|
||||
Test::Unit.runner = nil # protect the outer runner from the inner tests
|
||||
Test::Unit::Runner.runner = nil # protect the outer runner from the inner tests
|
||||
end
|
||||
|
||||
def teardown
|
||||
|
@ -57,13 +57,13 @@ class MetaMetaMetaTestCase < Test::Unit::TestCase
|
|||
def with_output
|
||||
synchronize do
|
||||
begin
|
||||
save = Test::Unit.output
|
||||
save = Test::Unit::Runner.output
|
||||
@output = StringIO.new("")
|
||||
Test::Unit.output = @output
|
||||
Test::Unit::Runner.output = @output
|
||||
|
||||
yield
|
||||
ensure
|
||||
Test::Unit.output = save
|
||||
Test::Unit::Runner.output = save
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -153,7 +153,7 @@ class TestMiniTestUnit < MetaMetaMetaTestCase
|
|||
end
|
||||
|
||||
def test_default_runner_is_minitest_unit
|
||||
assert_instance_of Test::Unit, Test::Unit.runner
|
||||
assert_instance_of Test::Unit::Runner, Test::Unit::Runner.runner
|
||||
end
|
||||
|
||||
|
||||
|
@ -497,7 +497,7 @@ class TestMiniTestRunner < MetaMetaMetaTestCase
|
|||
end
|
||||
|
||||
def test_run_with_other_runner
|
||||
Test::Unit.runner = Class.new Test::Unit do
|
||||
Test::Unit::Runner.runner = Class.new Test::Unit::Runner do
|
||||
def _run_suite suite, type
|
||||
suite.before_suite # Run once before each suite
|
||||
super suite, type
|
||||
|
@ -508,7 +508,7 @@ class TestMiniTestRunner < MetaMetaMetaTestCase
|
|||
def self.name; "wacky!" end
|
||||
|
||||
def self.before_suite
|
||||
Test::Unit.output.puts "Running #{self.name} tests"
|
||||
Test::Unit::Runner.output.puts "Running #{self.name} tests"
|
||||
@@foo = 1
|
||||
end
|
||||
|
||||
|
@ -1722,7 +1722,7 @@ class TestMiniTestUnitRecording < MetaMetaMetaTestCase
|
|||
@recording ||= Hash.new { |h,k| h[k] = [] }
|
||||
end
|
||||
|
||||
Test::Unit.runner = @tu
|
||||
Test::Unit::Runner.runner = @tu
|
||||
|
||||
Class.new Test::Unit::TestCase, &block
|
||||
|
||||
|
|
Loading…
Reference in a new issue