[rspec-users] no should raise_exception

Elliot Winkler elliot.winkler at gmail.com
Sun Dec 20 01:07:14 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")

-- Elliot

On Sat, Dec 19, 2009 at 11:12 PM, rogerdpack <rogerpack2005 at gmail.com> wrote:
> I know there's a raise_error
> however...exceptions are not always errors, so I had expected a
> raise_exception matcher...would this be a reasonable addition (I'd be
> happy to do it).
> Thanks.
> -r
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list