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

Cop idea: Identical equality assertion #1130

Closed
andyw8 opened this issue Feb 10, 2021 · 1 comment · Fixed by #1132
Closed

Cop idea: Identical equality assertion #1130

andyw8 opened this issue Feb 10, 2021 · 1 comment · Fixed by #1132
Labels

Comments

@andyw8
Copy link
Collaborator

andyw8 commented Feb 10, 2021

An assertion such as this is probably a typo or a flawed test (since it can never fail):

expect(foo.bar).to eq(foo.bar)

@pirj
Copy link
Member

pirj commented Feb 10, 2021

It can fail in rare cases, e.g. expect(factorial.next).to eq(factorial.next) would only succeed once. But it's of an exception and the possibility of a mistake is way higher.

I was about to swear that we've had a similar ticket in our backlog, but couldn't find anything. Thanks for submitting the idea!

@pirj pirj added the cop label Feb 10, 2021
@andyw8 andyw8 changed the title Cop idea: Identical assertion Cop idea: Identical equality assertion Feb 11, 2021
tejasbubane added a commit to tejasbubane/rubocop-rspec that referenced this issue Feb 13, 2021
tejasbubane added a commit to tejasbubane/rubocop-rspec that referenced this issue Feb 13, 2021
tejasbubane added a commit to tejasbubane/rubocop-rspec that referenced this issue Feb 13, 2021
tejasbubane added a commit to tejasbubane/rubocop-rspec that referenced this issue Feb 21, 2021
tejasbubane added a commit to tejasbubane/rubocop-rspec that referenced this issue Feb 21, 2021
tejasbubane added a commit to tejasbubane/rubocop-rspec that referenced this issue Mar 23, 2021
tejasbubane added a commit to tejasbubane/rubocop-rspec that referenced this issue Mar 23, 2021
tejasbubane added a commit to tejasbubane/rubocop-rspec that referenced this issue May 21, 2021
tejasbubane added a commit to tejasbubane/rubocop-rspec that referenced this issue May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants