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 #255] Add new Minitest/AssertOperator and Minitest/RefuteOperator cops #260

Commits on Sep 21, 2023

  1. [Fix rubocop#255] Add new Minitest/AssertOperator and `Minitest/Ref…

    …uteOperator` cops
    
    Fixes rubocop#255.
    
    This PR adds new `Minitest/AssertOperator` and `Minitest/RefuteOperator` cops.
    
    ## `Minitest/AssertOperator` cop
    
    This cop enforces the use of `assert_operator(expected, :<, actual)` over `assert(expected < actual)`.
    
    ```ruby
    # bad
    assert(expected < actual)
    
    # good
    assert_operator(expected, :<, actual)
    ```
    
    ## `Minitest/RefuteOperator` cop
    
    This cop enforces the use of `refute_operator(expected, :<, actual)` over `refute(expected < actual)`.
    
    ```ruby
    # bad
    refute(expected < actual)
    
    # good
    refute_operator(expected, :<, actual)
    ```
    koic committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    95e0cde View commit details
    Browse the repository at this point in the history