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

Fix a false negative for RSpec/PredicateMatcher when using include and respond_to #1532

Merged
merged 1 commit into from
Dec 26, 2022

Conversation

ydah
Copy link
Member

@ydah ydah commented Dec 26, 2022

This PR is fixed false negative in the following code:

expect(foo).to include('bar')
expect(foo).to respond_to(:method)

I noticed this when I was looking at the coverage of the test code generated by simplecov.

Before
before

After
after


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • [-] Updated documentation.
  • Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

…` and `respond_to`

This PR is fixed false negative in the following code:

```ruby
expect(foo).to include('bar')
expect(foo).to respond_to(:method)
```
@ydah ydah force-pushed the fix/predicate_matcher branch from 656a0e4 to 9558719 Compare December 26, 2022 13:55
Copy link
Member

@Darhazer Darhazer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@pirj
Copy link
Member

pirj commented Dec 26, 2022

Nice find, thank you!

@pirj pirj merged commit 4ff5ffe into rubocop:master Dec 26, 2022
@ydah ydah deleted the fix/predicate_matcher branch December 26, 2022 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants