Skip to content

Instantly share code, notes, and snippets.

@descentintomael
Created June 10, 2016 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save descentintomael/ab6af70b4e1e6a7b53867ea9ae7cf55d to your computer and use it in GitHub Desktop.
Save descentintomael/ab6af70b4e1e6a7b53867ea9ae7cf55d to your computer and use it in GitHub Desktop.
Simple method for raising custom errors in tests to test error handling
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