rubocop / rubocop-rails

A RuboCop extension focused on enforcing Rails best practices and coding conventions.
https://docs.rubocop.org/rubocop-rails
MIT License
819 stars 263 forks source link

Make `Minitest/AssertPredicate` aware of `assert_not_predicate` #1155

Open Earlopain opened 1 year ago

Earlopain commented 1 year ago

Is your feature request related to a problem? Please describe.

Currently Minitest/AssertPredicate corrects assert(foo.bar?) to assert_predicate(foo, :bar?). It would be nice if the same is also true for the negation of this. assert_not(foo.bar?) to assert_not_predicate(foo, :bar?).

I have openend this issue here instead of the minitest gem because assert_not_predicate and assert_not are rails specific methods.

Earlopain commented 8 months ago

@koic could you give me some pointers on how you would approach this? I'm not sure where I would start when implementing.

Would it make sense to: