You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@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:
Make Minitest/AssertPredicate aware of this by default
Add a config to Minitest/AssertPredicate that would be default enhanced here if the gem is present (are there other cops here that do this I could look take a look at?)
Something else entirely?
Earlopain
added a commit
to Earlopain/rubocop-rails
that referenced
this issue
Mar 22, 2024
This converts `assert_not(obj.one?)` into `assert_not_predicate(obj, :one?)`
These methods are rails-specific and not present by default in minitest.
For users that prefer the `refute` method calls, `Rails/RefuteMethods` will correct this if configured that way.
Both the code and tests are pretty much a one-to-one copy from rubocop-minitest.`RefutePredicate`
Is your feature request related to a problem? Please describe.
Currently
Minitest/AssertPredicate
correctsassert(foo.bar?)
toassert_predicate(foo, :bar?)
.It would be nice if the same is also true for the negation of this.
assert_not(foo.bar?)
toassert_not_predicate(foo, :bar?)
.I have openend this issue here instead of the minitest gem because
assert_not_predicate
andassert_not
are rails specific methods.The text was updated successfully, but these errors were encountered: