rubocop / rubocop-rspec

Code style checking for RSpec files.
https://docs.rubocop.org/rubocop-rspec
MIT License
810 stars 276 forks source link

Suggestion: Smarter subject stub cop #295

Open andyw8 opened 7 years ago

andyw8 commented 7 years ago

I wonder if it would be feasible to checking for stubbing the SUT even when subject isn't used, e.g.:

it "..." do
  loan = Foo.new
  allow(loan).to receive(:bar).and_return(:baz)
  expect(loan.bar).to eq(:baz)
end
Darhazer commented 6 years ago

Related to #311