Workaround for Minitest5

This commit is contained in:
Hiroshi SHIBATA 2020-05-07 20:19:42 +09:00
parent 7050f86ae1
commit 1fe2b7f41c
Notes: git 2020-05-08 07:39:31 +09:00
2 changed files with 5 additions and 0 deletions

View File

@ -181,10 +181,12 @@ module MiniTest
def _assertions= n # :nodoc:
@_assertions = n
end
alias assertions= _assertions=
def _assertions # :nodoc:
@_assertions ||= 0
end
alias assertions _assertions
##
# Fails unless +test+ is a true value.

View File

@ -1372,6 +1372,9 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
assert_not_same assert_nothing_raised
assert_nothing_thrown assert_raise]
# These are compatibility methods for Minitest 5
ignores += %w[assertions assertions=]
asserts = methods.grep(/^assert/).sort - ignores
refutes = methods.grep(/^refute/).sort - ignores