[rspec-devel] [ rspec-Feature Requests-6265 ] should_raise should accept an Exception object

noreply at rubyforge.org noreply at rubyforge.org
Tue Oct 24 02:51:26 EDT 2006


Feature Requests item #6265, was opened at 2006-10-22 05:46
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6265&group_id=797

Category: mock module
Group: None
Status: Closed
Priority: 3
Submitted By: Chad Woolley (thewoolleyman)
Assigned to: Nobody (None)
Summary: should_raise should accept an Exception object

Initial Comment:
So I can pass it an exception object with the message (or anything else) set on it.

----------------------------------------------------------------------

>Comment By: Chad Woolley (thewoolleyman)
Date: 2006-10-24 06:51

Message:
Yes, I meant "and_raise", it was a typo.  I will try the
Proc#should_raise and see if that works.

Thanks,
Chad

----------------------------------------------------------------------

Comment By: Aslak Hellesoy (aslak_hellesoy)
Date: 2006-10-22 12:42

Message:
I'm a little confused. You categorised this RFE in the mock module. RSpec mocks don't have a sould_raise method, but an and_raise method (which allows you to pass in an exception)

http://rspec.rubyforge.org/documentation/mocks.html
http://rubyforge.org/cgi-bin/viewvc.cgi/trunk/spec/spec/mocks/mock_spec.rb?revision=931&root=rspec

Or perhaps you're talking about the Proc#should_raise method? It also allows you to pass an exception object:

http://rubyforge.org/cgi-bin/viewvc.cgi/trunk/spec/spec/expectations/should/should_raise_spec.rb?root=rspec&view=co
http://rspec.rubyforge.org/documentation/expectations.html

If this doesn't work for you, please submit a failing spec.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6265&group_id=797


More information about the rspec-devel mailing list