Open MatzFan opened 2 months ago
This is not the best solution. It will ignore all custom assertions the user may have written themselves, and test methods provided by gems like rails.
I think it would be better to instead only look at methods that have no receiver.
@Earlopain
It will ignore all custom assertions the user may have written themselves, and test methods provided by gems like rails.
Apologies, I didn't see that tested for anywhere.
I think it would be better to instead only look at methods that have no receiver.
Or where the receiver is not a kind_of Minitest::Test
?
Apologies, I didn't see that tested for anywhere.
I guess the assert_something
call you changed could be counted as that but yes, it isn't very explicit in the test suite yet. Let's just add a testcase for custom assertion methods with this PR.
Or where the receiver is not a kind_of Minitest::Test?
Perhaps, but not decidable by rubocop. It can't tell if MyCustomTestCase
or AcitveSupport::TestCase
inherit from Minitest::Test
. Just no receiver seems fine, unless you see a problem with that yourself.
Please add a changelog entry for this, and write a meaningful commit message starting with [Fix #321]
. Thanks!
Will take a :eyes:
Counting assertions based on a string prefix of "assert" or "refute" is replaced by a symbol comparison against the 38 Minitest assertion methods.