[rspec-users] Trouble validating an exception

Scott Taylor scott at railsnewbie.com
Mon Feb 2 19:27:08 EST 2009


On Feb 2, 2009, at 6:30 PM, Ben Greenberg wrote:

> Hi all,
>
> This spec always passes:
>
>    lambda do
>      process_card @credit_card, billing_info, 10604, '1.1.1.1',  
> @gateway
>    end.should raise_error(MinimalCart::CaptureFailureError) do |ex|
>      ex.should be_nil
>      ex.should_not be_nil
>      ex.responses.should be_nil
>      ex.responses.should_include @auth_response
>      ex.responses.include?.with('a').should be_true
>    end
>
> Clearly, it makes no sense.  Somehow the exception validation block  
> is not running.  What am I doing wrong?

Disregard my last email.  I was being stupid.

Scott



More information about the rspec-users mailing list