[rspec-users] How do I specify that a class does not receive any message

J. B. Rainsberger me at jbrains.ca
Tue Aug 21 20:12:09 UTC 2012

On Tue, Aug 21, 2012 at 5:02 PM, Andrew Premdas <apremdas at gmail.com> wrote:

> I want to write
> it "should ..." do
>   Client.should_not_receive(any_message)
>   # do something here that might do Client.xxx
> end

I might be wrong, but if you use a mock object and set no expectations on
it, it will expect no messages. Have you tried that?
J. B. (Joe) Rainsberger :: http://www.jbrains.ca ::
Author, JUnit Recipes
Free Your Mind to Do Great Work :: http://www.freeyourmind-dogreatwork.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120821/fb887d2a/attachment-0001.html>

More information about the rspec-users mailing list