rubocop / rubocop-minitest

Code style checking for Minitest files.
https://docs.rubocop.org/rubocop-minitest
MIT License
144 stars 44 forks source link

Enhance `AssertSame`/`RefuteSame` to check for `object_id` comparison #276

Closed fatkodima closed 1 year ago

fatkodima commented 1 year ago

It is a very popular pattern:

# bad
assert_equal(expected.object_id, actual.object_id)

# good
assert_same(expected, actual)

Tested on rails/rails codebase and got 11 offenses.

koic commented 1 year ago

Thanks!