On Tue, Dec 22, 2009 at 9:33 AM, rogerdpack <[email protected]> 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")
>
> 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."
>
What I really want to say is "should raise(Blah)" but Ruby already defines
raise as a keyword :)
I'd be open to aliasing raise_error with raise_exception, renaming it to
raise_exception and aliasing raise_error for compatibility, but I think this
might just add confusion rather than clarifying intent. Thoughts?
David
> -r
>
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users