[Rspec-devel] Mock API - should_not_receive

DeeJay smartgpx at gmail.com
Wed Aug 30 05:53:03 EDT 2006

I would like to be able to specify that under given circumstances a
particular message
from my application is NOT returned to the user. [eg. IF Bank_Balance is
Positive THEN
Credit_Status_Report should NOT be "you are overdrawn."]

I can do -

specify "correct output" do
  my_mock_output.should_receive(:msg).with("expected text")

By trying for a PLS solution, I would hope to be able to write -

 specify "unwanted output" do
  my_mock_output.should_not_receive(:msg).with("unwanted text")

But that fails - it looks as though 'with' is not implemented for

Is there a way of expressing this logic in the API as it stands, or should
I submit a Feature Request?

Thanks -

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20060830/9492df21/attachment.html 

More information about the Rspec-devel mailing list