Forum: Ruby RSpec - should_raise method?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A0599814ceddc2e283792f4e47c57f5e?d=identicon&s=25 Brian Takita (Guest)
on 2005-12-16 20:28
(Received via mailing list)
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
This topic is locked and can not be replied to.