[rspec-users] should_receive(:x).at_most/exactly... ignored when method is previously stubbed?

Ashley Moran ashley.moran at patchspace.co.uk
Tue Dec 1 13:24:17 EST 2009


On Dec 01, 2009, at 4:46 pm, Lenny Marks wrote:

> This seems dangerous to me. Assuming I hadn't initially stubbed in the before block and everything worked as expected, if someone later stubs :lookup in the before block because they are adding new examples that don't care about it, my explicit example becomes misleadingly useless.
> 
> Does this surprise anyone else?

Hi Lenny

Yes it does, so much so that I filed a ticket[1] :)

Well, I think it's the same issue.  If so, maybe you'll find the discussion between me and David useful.

HTH

Ashley

[1] https://rspec.lighthouseapp.com/projects/5645/tickets/618-exactlyntimes-incorrectly-failing-for-n-actual

-- 
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran



More information about the rspec-users mailing list