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

Lenny Marks lenny at aps.org
Tue Dec 1 14:34:57 EST 2009


On Dec 1, 2009, at 1:24 PM, Ashley Moran wrote:

>
> 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
>


Thanks Ashley. I added my 2 cents to the ticket.

-lenny


More information about the rspec-users mailing list