[Rspec-devel] Mock API - should_not_receive

David Chelimsky dchelimsky at gmail.com
Wed Aug 30 05:59:15 EDT 2006


For today you can still use should_receive(:msg).with("unwanted
text").never, but that will be removed in version 0.7 or 0.8.

Please submit a feature request for this. We can add this before we
remove the "never" syntax.

Thanks,
David


On 8/30/06, DeeJay <smartgpx at gmail.com> wrote:
>
>
> 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")
> end
>
> 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")
> end
>
> But that fails - it looks as though 'with' is not implemented for
> should_not_receive.
>
> Is there a way of expressing this logic in the API as it stands, or should
> I submit a Feature Request?
>
> Thanks -
>
> DeeJay
>
> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>
>


More information about the Rspec-devel mailing list