Created
April 19, 2012 11:02
-
-
Save tcrayford/2420252 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
specify "the first time rspec has made me sad" do | |
class CustomError < RuntimeError; end | |
expect do | |
raise CustomError.new('what') | |
end.to raise_error(CustomError.new('what')) | |
end |
Still fails. Thanks though.
You can't give raise_error
an instance - it needs to be an exception type: raise_error(CustomError)
.
It sorta makes sense, assuming Exceptions don't implement ==
well.
I think ===
is used to match exceptions - also by rescue
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
raise_error
?