Skip to content

Instantly share code, notes, and snippets.

@descentintomael
Created June 10, 2016 16:26
Show Gist options
  • 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