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 positive for RSpec/StubbedMock when stubbed message expectation with a block and block parameter #1546

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

ydah
Copy link
Member

@ydah ydah commented Jan 11, 2023

Fix: #1518

For the context, we don't want to conside expect.to receive(:foo) { |arg, arg2| ... } an offence, since most likely the block contains expectations on arguments.
If it's an allow, those argument expectations might be missed of foo is not called.


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).

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Awesome, thank you!

@pirj pirj merged commit 72679bb into rubocop:master Jan 11, 2023
@ydah ydah deleted the fix/1518 branch January 12, 2023 09:14
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.

RSpec/StubbedMock false positive
3 participants