-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New cop: Minitest/HooksGrouping
#214
Comments
Yeah, the naming is difficult too, there is a better name 😅 Anyway, I think it's worth opening up to the style guide first: |
Better name would be Additionally I think it should check for all hooks including the # bad
class SomethingTest < Minitest::Test
def after_teardown; end
def before_teardown; end
def setup; end
def before_setup; end
def after_setup; end
def teardown; end
end
# good
class SomethingTest < Minitest::Test
def before_setup; end
def setup; end
def after_setup; end
def before_teardown; end
def teardown; end
def after_teardown; end
end |
Or there is a better name for this cop.
It will check that
setup
/teardown
are before all the test cases, and thatsetup
is beforeteardown
. It adds consistency and enforces the expectation of these methods to go first (to be easily noticeable/etc).The text was updated successfully, but these errors were encountered: