rubocop-rspec
rubocop-rspec copied to clipboard
Focus cop raises incorrectly on variables named `fit`.
Example:
let(:fit) { Tax.federal_income_tax }
let(:fit_attributes) { tax_id: fit.id }
raises
C: RSpec/Focus: Focused spec found.
{ tax_id: fit.id }
^^^
Interesting. Assuming calling fit
inside of an example doesn't focus the test then we should definitely stop searching for focusing method calls once we know we are inside of an example. Thanks for the bug report
I suggest adding a (block
part to the node pattern.
I've checked that fit
without a block does not focus, so it does not make much sense to flag it.
You've been taking a stab at this, WDYT @dgollahon ?
I'd need to go over my old code to check if that'd work or not but my memory is that it's a bit trickier than that. I'll hopefully have some time to look over this in the next couple of weeks.