1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

MiniTest::Unit.options has default :seed

MiniTest::Unit (superclass of Test::Unit::Runner) does not has
default seed parameter, but assigned after initializing.
However some tests use MiniTest::Unit without setup of seed option
and it cases unexpected test failures. To solve this issue, add
default seed parameter 42.
This commit is contained in:
Koichi Sasada 2020-02-27 04:06:28 +09:00
parent 14f1790807
commit 6b30638bdb
2 changed files with 1 additions and 2 deletions

View file

@ -763,7 +763,7 @@ module MiniTest
# Lazy accessor for options.
def options
@options ||= {}
@options ||= {seed: 42}
end
@@installed_at_exit ||= false

View file

@ -47,7 +47,6 @@ class MetaMetaMetaTestCase < MiniTest::Unit::TestCase
srand 42
MiniTest::Unit::TestCase.reset
@tu = MiniTest::Unit.new
@tu.options[:seed] = 42
MiniTest::Unit.runner = nil # protect the outer runner from the inner tests
end