Created
June 10, 2016 16:26
-
-
Save descentintomael/ab6af70b4e1e6a7b53867ea9ae7cf55d to your computer and use it in GitHub Desktop.
Simple method for raising custom errors in tests to test error handling
This file contains 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
def new_error(message = 'oops', klass = RuntimeError) | |
raise klass, message | |
rescue | |
return $! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment