[rspec-users] no should raise_exception

rogerdpack rogerpack2005 at gmail.com
Tue Dec 22 10:33:30 EST 2009

> raise_error already catches any type of exception, error or not:
>   class BlahException < Exception; end
>   class BlahError < StandardError; end
>   lambda { raise BlahException }.should raise_error(BlahException)
>   lambda { raise BlahError }.should raise_error(BlahError)
>   lambda { raise "blah" }.should raise_error(RuntimeError, "blah")

Thanks for the response.  I think my request was more of a "why call
them errors--in my head one doesn't raise errors--one raises
exceptions and interprets them as errors, so allowing for the syntax
raise_exception would be more mind friendly to me."


More information about the rspec-users mailing list