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
|
super
|
||||||
srand 42
|
srand 42
|
||||||
Test::Unit::TestCase.reset
|
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
|
end
|
||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
|
@ -57,13 +57,13 @@ class MetaMetaMetaTestCase < Test::Unit::TestCase
|
||||||
def with_output
|
def with_output
|
||||||
synchronize do
|
synchronize do
|
||||||
begin
|
begin
|
||||||
save = Test::Unit.output
|
save = Test::Unit::Runner.output
|
||||||
@output = StringIO.new("")
|
@output = StringIO.new("")
|
||||||
Test::Unit.output = @output
|
Test::Unit::Runner.output = @output
|
||||||
|
|
||||||
yield
|
yield
|
||||||
ensure
|
ensure
|
||||||
Test::Unit.output = save
|
Test::Unit::Runner.output = save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -153,7 +153,7 @@ class TestMiniTestUnit < MetaMetaMetaTestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_default_runner_is_minitest_unit
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -497,7 +497,7 @@ class TestMiniTestRunner < MetaMetaMetaTestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_run_with_other_runner
|
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
|
def _run_suite suite, type
|
||||||
suite.before_suite # Run once before each suite
|
suite.before_suite # Run once before each suite
|
||||||
super suite, type
|
super suite, type
|
||||||
|
@ -508,7 +508,7 @@ class TestMiniTestRunner < MetaMetaMetaTestCase
|
||||||
def self.name; "wacky!" end
|
def self.name; "wacky!" end
|
||||||
|
|
||||||
def self.before_suite
|
def self.before_suite
|
||||||
Test::Unit.output.puts "Running #{self.name} tests"
|
Test::Unit::Runner.output.puts "Running #{self.name} tests"
|
||||||
@@foo = 1
|
@@foo = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1722,7 +1722,7 @@ class TestMiniTestUnitRecording < MetaMetaMetaTestCase
|
||||||
@recording ||= Hash.new { |h,k| h[k] = [] }
|
@recording ||= Hash.new { |h,k| h[k] = [] }
|
||||||
end
|
end
|
||||||
|
|
||||||
Test::Unit.runner = @tu
|
Test::Unit::Runner.runner = @tu
|
||||||
|
|
||||||
Class.new Test::Unit::TestCase, &block
|
Class.new Test::Unit::TestCase, &block
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue