Closed faisal closed 11 months ago
Thank you for your early feedback! This bug was fixed in https://github.com/rubocop/rubocop-minitest/releases/tag/v0.34.1.
Thank you for your early feedback! This bug was fixed in https://github.com/rubocop/rubocop-minitest/releases/tag/v0.34.1.
Fix confirmed. Thank you!
As of rubocop-minitest 0.34.0, Rubocop Minitest produces a large number of errors of the form
An error occurred while [cop] cop was inspecting [file]
when run against source that uses setter methods. I've seen this with the Minitest/EmptyLineBeforeAssertionMethods and Minitest/MultipleAssertions cops, though it may also happen with others.When running rubocop with
-d
, the errors all raise at _lib/rubocop/cop/mixin/minitest_exploration_helpers.rb:103:in `assertionmethod?'.I have confirmed the problem doesn't occur with rubocop-minitest 0.33.0, both by uninstalling 0.34.0 and by running rubocop in a bundle that locks rubocop-minitest 0.33.0.
Expected behavior
If RuboCop Minitest 0.33.0 was able to inspect a test file, RuboCop Minitest 0.34.0 should be able to inspect a test file. It might report issues it wasn't able to report before, but it shouldn't fail with apparently spurious errors.
Actual behavior
RuboCop Minitest 0.34.0 fails at class boundaries or individual lines, failing out in _RuboCop::Cop::MinitestExplorationHelpers#assertionmethod?
Steps to reproduce the problem
Below, I've included a test case that always fails for me, as well as the output of such a run.
RuboCop version
Test case
_test/models/exampletest.rb:
Running _rubocop test/models/exampletest.rb -d I get: