Closed corsonknowles closed 1 week ago
Hmm, I think this spec passes both before and after the change, so there is some issue here:
it 'flags `are_expected`' do
expect_offense(<<~RUBY)
are_expected.to receive(:bar).and_return(:baz)
^^^^^^^^^^^^ Prefer `` over `are_expected` when configuring a response.
RUBY
end
Okay, I pushed up a real change -- now it only flags on the methods it can correct.
Thoughts?
Okay, how's this approach?
Perfect, thank you, @corsonknowles !
Fix edge case for
StubbedMock
where it could return a blank suggestion for unhandled Expectation types.Completes branch coverage for this file.
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).If you have created a new cop:
config/default.yml
.Enabled: pending
inconfig/default.yml
.Enabled: true
in.rubocop.yml
.VersionAdded: "<<next>>"
indefault/config.yml
.If you have modified an existing cop's configuration options:
VersionChanged: "<<next>>"
inconfig/default.yml
.