Please sign in to comment.
Simplify spec for FormatterSet
This line: expect(formatter_set).to all(have_received(:started).with(files)) previously was expect(formatter_set).to all(receive(:started).with(files)) but was triggering a RSpec/SubjectStub offence, and there was a special case treatment introduced to `rubocop-rspec` to relax detection of stubbing when `all` matcher is used together with a message expectation matcher. The cop is not at the moment able to detect `have_received` matcher, but there is an open pull request to improve the detection. That pull request (rubocop-hq/rubocop-rspec#770) is also aiming to remove that special case treatment, because, as experiment has shown, across [`real-world-ruby-apps`](https://github.com/jeromedalbert/real-world-ruby-apps) and [`real-world-rails`](https://github.com/eliotsykes/real-world-rails), there is no other offences detected apart from this `FormatterSet` spec. In any case, the rest of the spec don't use `all`, and are explicit of which object the expectation is made against (by using ``, ``). Also, using spies is not justified in this case. It doesn't make much sense to use a `before` hook that is only run along with a single example.
- Loading branch information...
Showing with 5 additions and 12 deletions.