use Minitest::Unit.current_repeat_count to skip multi-run.

This commit is contained in:
Koichi Sasada 2020-01-28 18:20:06 +09:00
Родитель dd64c34682
Коммит 471a969311
1 изменённых файлов: 2 добавлений и 6 удалений

Просмотреть файл

@ -217,8 +217,6 @@ class TestRefinement < Test::Unit::TestCase
assert_raise(NoMethodError) { FooExtClient.public_send_b_on(foo) }
end
DONE_TESTS = []
module MethodIntegerPowEx
refine Integer do
def pow(*)
@ -227,8 +225,7 @@ class TestRefinement < Test::Unit::TestCase
end
end
def test_method_should_use_refinements
skip if DONE_TESTS.include? __method__ # giveup multi-run
DONE_TESTS << __method__
skip if Minitest::Unit.current_repeat_count > 0
foo = Foo.new
assert_raise(NameError) { foo.method(:z) }
@ -251,8 +248,7 @@ class TestRefinement < Test::Unit::TestCase
end
end
def test_instance_method_should_use_refinements
skip if DONE_TESTS.include? __method__ # giveup multi-run
DONE_TESTS << __method__
skip if Minitest::Unit.current_repeat_count > 0
foo = Foo.new
assert_raise(NameError) { Foo.instance_method(:z) }