RSpec - should_raise method?

B

Brian Takita

------=_Part_12554_13728394.1134761150178
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hello,

Does RSpec provide a way to check if an exception gets raised?
I would expect a method named should_raise, but I cant find it.

Something like the following should work in the specs, but a method should
be added.

should do
begin
call_method
false
rescue
true
end
end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top