Created
April 19, 2012 11:02
-
-
Save tom-pang/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 |
Author
Still fails. Thanks though.
You can't give raise_error an instance - it needs to be an exception type: raise_error(CustomError).
Author
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?