Skip to content

[Bug] Minitest/Assert* having conflicts with Rails/RefuteMethods policy #319

@bogdan

Description

@bogdan

Bug Description

The rules Minitest/Assert* has some conflicts with Rails/RefuteMethods. It has default policy to convert refute_* statements to assert_not_* which causes Minitest/Assert* to be ignored.

Example:

# Statement
refute user.new_record?
# Will be converted by Rails/RefuteMethods to
assert_not user.new_record? 
# And will be ignored by Minitest/AssertPredicate

Fix

Make all rules consistent when converting generic refute or assert_not statements to refute_* or assert_not_* statements making sure it supports default policy established by Rails/RefuteMethods:

# bad
assert_not(obj.one?)
assert_not(obj.one?, 'message')

# good
assert_not_predicate(obj, :one?)
assert_not_predicate(obj, :one?, 'message')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions