Forum: Ruby Mocha: does_not_expect

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2009-04-17 14:09
Hi,

I am writing tests for a Rails app using Test::Unit and Mocha. expects
does a great job to make sure a method is called. But how to handle the
fact that a method shouldn't be called?

I have a before filter that protects the call to a given restricted
method, and how to make sure that this method doesn't get called
unexpectedly?
146e52d49d361f85c0945487452fc6a0?d=identicon&s=25 Ben Lovell (benl)
on 2009-04-17 14:24
(Received via mailing list)
On Fri, Apr 17, 2009 at 1:09 PM, Fernando Perez
<pedrolito@lavache.com>wrote:

> Posted via http://www.ruby-forum.com/.
>
>
some_object.expects(:expected_method).never

Regards,
Ben
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2009-04-17 14:34
> some_object.expects(:expected_method).never

Damnd I never thought about such method while reading the API.

Thank you very much.
146e52d49d361f85c0945487452fc6a0?d=identicon&s=25 Ben Lovell (benl)
on 2009-04-17 14:41
(Received via mailing list)
On Fri, Apr 17, 2009 at 1:34 PM, Fernando Perez
<pedrolito@lavache.com>wrote:

>
> > some_object.expects(:expected_method).never
>
> Damnd I never thought about such method while reading the API.
>
> Thank you very much.


Yeah I missed it first time round too :)

Ben
This topic is locked and can not be replied to.