summaryrefslogtreecommitdiff
path: root/test/minitest
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-11 12:24:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-11 12:24:16 +0000
commitac8c23f1b5494a968d299b4b625449348f385eca (patch)
treee215c3227dbf1a172d4eac7fe844c9d4a5254bc0 /test/minitest
parentbe4b1c1e2c55fb812d6ad2b9d88c5357e06a9f9e (diff)
downloadruby-ac8c23f1b5494a968d299b4b625449348f385eca.tar.gz
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
Diffstat (limited to 'test/minitest')
-rw-r--r--test/minitest/test_minitest_unit.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/test/minitest/test_minitest_unit.rb b/test/minitest/test_minitest_unit.rb
index 315c36d416..b70c099d01 100644
--- a/test/minitest/test_minitest_unit.rb
+++ b/test/minitest/test_minitest_unit.rb
@@ -1623,15 +1623,11 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
def test_test1; assert "does not matter" end
def test_test2; 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
- srand 42
- expected = case
- when maglev? then
- %w(test_test2 test_test3 test_test1)
- else
- %w(test_test2 test_test1 test_test3)
- end
+ expected = %w(test_test2 test_test1 test_test3)
assert_equal expected, sample_test_case.test_methods
end