On Dec 20, 2009, at 6:07 am, Elliot Winkler wrote:
> 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")
Although it would be unusual to catch non-Error Exceptions in most cases? Most
indicate unrecoverable failure; only the SignalException looks like something
you might want to catch - I don't know, though. I assume you'd normally
register a handler for that.
Ashley
--
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users