"Use let instead of an instance variable" doesn't make sense in cases where an instance variable is used unnecessarily rather than a local variable. For example within a before block, assuming @foo isn't used anywhere else:
before do
@foo = 'bar'
widget.stub(@foo)
end
It might still be used somewhere in the shared example, and we won't be able to detect that usage.
Did you have a more generic message in mind, like "Don't use an instance variable"?
How about: "Avoid instance variables – use let, a method call, or a local variable (if possible)"
This sounds just right.
@bquorning @Darhazer WDYT? I can make this change quickly.
I like it.
Most helpful comment
This sounds just right.
@bquorning @Darhazer WDYT? I can make this change quickly.