[rspec-users] Verifying that a block calls a method

nicholas a. evans nick at ekenosen.net
Tue Apr 17 13:03:06 EDT 2007

On 4/17/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:
> def my_fun
>    my_fun2 do
>         raise Error
>    end
> end
> I know that I can verify that the method receives my_fun2.  How can I
> mock/stub out the example to verify that it calls raise Error?

Have you tried "should raise_error(...)"?

lambda { my_fun }.should raise_error



More information about the rspec-users mailing list