I'm quite lost with this example:
expect do
make_request
end.to enqueue_job(DeliverEventWebhookJob)
.with { |event_name, _claim_id| expect(event_name).to eq("claim_renewed") }
The offence is:
W: Lint/AmbiguousBlockAssociation: Parenthesize the param with to make sure that the block will be associated with the to method call.
expect do ...
^^^^^^^^^
I tried few other ways, but either Rubocop is not happy or it's not a valid Ruby syntax.
$ rubocop -V
0.48.0 (using Parser 2.4.0.0, running on ruby 2.4.1 x86_64-linux)
I would probably recommend disabling this cop for specs, since it's a deliberate idiom in RSpec. 馃檪
Lint/AmbiguousBlockAssociation:
Exclude:
- "spec/**/*"
Exactly.
Most helpful comment
I would probably recommend disabling this cop for specs, since it's a deliberate idiom in RSpec. 馃檪