зеркало из https://github.com/github/ruby.git
test_minitest_unit.rb: fix "random" sort
* test/minitest/test_minitest_unit.rb (test_test_methods_random): hack to fix the order by avoiding duplicate keys. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
be4b1c1e2c
Коммит
ac8c23f1b5
|
@ -1623,15 +1623,11 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
|
||||||
def test_test1; assert "does not matter" end
|
def test_test1; assert "does not matter" end
|
||||||
def test_test2; assert "does not matter" end
|
def test_test2; assert "does not matter" end
|
||||||
def test_test3; assert "does not matter" end
|
def test_test3; assert "does not matter" end
|
||||||
|
@test_order = [1, 0, 2]
|
||||||
|
def self.rand(n) @test_order.shift; end
|
||||||
end
|
end
|
||||||
|
|
||||||
srand 42
|
expected = %w(test_test2 test_test1 test_test3)
|
||||||
expected = case
|
|
||||||
when maglev? then
|
|
||||||
%w(test_test2 test_test3 test_test1)
|
|
||||||
else
|
|
||||||
%w(test_test2 test_test1 test_test3)
|
|
||||||
end
|
|
||||||
assert_equal expected, sample_test_case.test_methods
|
assert_equal expected, sample_test_case.test_methods
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче