Mocha: does_not_expect

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?

On Fri, Apr 17, 2009 at 1:09 PM, Fernando P.
[email protected]wrote:

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

some_object.expects(:expected_method).never

Regards,
Ben

some_object.expects(:expected_method).never

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

Thank you very much.

On Fri, Apr 17, 2009 at 1:34 PM, Fernando P.
[email protected]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 :slight_smile:

Ben

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs