[rspec-users] should raise_error

Nick Hoffman nick at deadorange.com
Thu Sep 25 13:44:13 EDT 2008

On 2008-09-25, at 13:35, David Chelimsky wrote:
> On Thu, Sep 25, 2008 at 9:33 AM, Nick Hoffman <nick at deadorange.com>  
> wrote:
>> Thanks for that tip, Mark. When you have a minute, would you mind  
>> explaining
>> why #should needs to be sent to a Proc?
> Precisely because of the problem you're experiencing. If you look at
> the code for Spec::Matchers::RaiseError, you'll see that it accepts a
> proc and calls it in the context of a begin/rescue structure - saving
> you from having to do that in your example.
> Make sense?

I just had a peek at Spec::Matchers::RaiseError#matches? and see the  
begin..rescue there. Thanks, David.

More information about the rspec-users mailing list