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

Pete Campbell lists at ruby-forum.com
Thu Mar 17 21:24:34 EDT 2011

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 

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.

Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list