Skip to content
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

[Fix #279] Add new Minitest/NonExecutableTestMethod cop #280

Merged

Commits on Dec 14, 2023

  1. [Fix rubocop#279] Add new Minitest/NonExecutableTestMethod cop

    Resolves rubocop#279.
    
    This PR adds new `Minitest/NonExecutableTestMethod` cop, which checks for
    the use of test methods outside of a test class.
    Test methods should be defined within a test class to ensure their execution.
    
    NOTE: This cop assumes that classes whose superclass name includes the word
    "`Test`" are test classes, in order to prevent false positives.
    
    ```ruby
    # bad
    class FooTest < Minitest::Test
    end
    def test_method_should_be_inside_test_class
    end
    
    # good
    class FooTest < Minitest::Test
      def test_method_should_be_inside_test_class
      end
    end
    ```
    koic committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    6306fd5 View commit details
    Browse the repository at this point in the history