Skip to content

Commit 6384eec

Browse files
yahondarafaelfranca
authored andcommitted
Enable Minitest/NonExecutableTestMethod cop
This pull request enables `Minitest/NonExecutableTestMethod` cop to find non-executed test that is out of `ActiveSupport::TestCase` and its subclasses. This cop is based on the request since there was a test that is not executed found at rails#50334 (comment) and implemented to RuboCop Minitest 0.34.0 via rubocop/rubocop-minitest#279 This cop works as follows. As of right now, there is no offenses by reverting the merge commit via rails#50334 ``` $ git revert -m 1 9517841 $ bundle exec rubocop Inspecting 3254 files ... snip ... Offenses: activerecord/test/cases/assertions/query_assertions_test.rb:27:5: W: Minitest/NonExecutableTestMethod: Test method should be defined inside a test class to ensure execution. def test_assert_no_queries ... ^^^^^^^^^^^^^^^^^^^^^^^^^^ 3254 files inspected, 1 offense detected $ ``` * `Gemfile.lock` has been updated as follows ``` bundle update rubocop rubocop-minitest --conservative ```
1 parent aadecbe commit 6384eec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,9 @@ Minitest/AssertWithExpectedArgument:
367367
Minitest/LiteralAsActualArgument:
368368
Enabled: true
369369

370+
Minitest/NonExecutableTestMethod:
371+
Enabled: true
372+
370373
Minitest/SkipEnsure:
371374
Enabled: true
372375

0 commit comments

Comments
 (0)