[rspec-users] Counter.should_not_receive(:message) not working?

David Chelimsky dchelimsky at gmail.com
Thu Mar 17 23:53:23 EDT 2011

On Mar 17, 2011, at 8:24 PM, Pete Campbell wrote:

> Justin Ko wrote in post #988060:
>> I would say "count_me" is not returning what you think it is. Try adding
>> "raise count_me.inspect" in the controller action to see if this is the
>> case.
> Thanks for the feedback. The code snippet isn't the exact code, it is 
> simplified to demonstrate the problem I'm having (or think that I'm 
> having). I know that the count_me values are set correctly when 
> experiencing this problem. I also know when the Counter methods are 
> executed or not (lots of 'puts'!), so I'm sure that the Counter is 
> receiving the message but the .should_not_receive isn't raising an 
> error.
> I'm probably doing something incorrect w/r/t the way you're supposed to 
> use mocks in RSpec, but so far I haven't found what that is.

Please post a single, complete example in a gist that we can copy into a file and run so we can see the problem locally.


More information about the rspec-users mailing list