-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Add eql/equal support to RSpec/PredicateMatcher #2032
Conversation
ab5f824
to
ec1e83b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great find! Another win for coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -106,7 +106,7 @@ def rewrite_matcher(corrector, predicate, matcher) | |||
|
|||
def true?(to_symbol, matcher) | |||
result = case matcher.method_name | |||
when :be, :eq | |||
when :be, :eq, :eql, :equal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few aliases to make this complete? https://github.com/rspec/rspec/blob/a80119c703d38f993c414490abe8c992154cf5d1/rspec-expectations/lib/rspec/matchers.rb#L578
I just went there just in case, I don't think I've seen those used once in my practice 🙈 So really up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I have never seen those used either. I think there’s no need to add them now.
The `be_bool?` node matcher was already finding nodes using `eql` and `equal`, but then didn't properly handle them.
ec1e83b
to
49b9b21
Compare
The
be_bool?
node matcher was already finding nodes usingeql
andequal
, but then didn't properly handle them.Before submitting the PR make sure the following are checked:
master
(if not - rebase it).CHANGELOG.md
if the new code introduces user-observable changes.bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).