rubocop-minitest
rubocop-minitest copied to clipboard
Detect missing `super` calls in `setup` and `teardown`
From the minitest README:
If you want to extend your test using setup/teardown via a module, just make sure you ALWAYS call super.
I'd love to have a cop to check for this.
Is your feature request related to a problem? Please describe.
While debugging some intermittently test failures, I found a missing setup
call.
Describe the solution you'd like
.
Describe alternatives you've considered
.
Additional context
.
I think this is worth mentioning in the style guide. Can you open the proposal with example code to the Minitest Style Guide? https://github.com/rubocop-hq/minitest-style-guide
https://github.com/rubocop-hq/minitest-style-guide/pull/35
Static analysis does not know if included module contains setup
and teardown
methods - so I am not sure if this cop can be implemented effectively.