Skip to content

Instantly share code, notes, and snippets.

@Rojo
Last active August 29, 2015 14:27
Show Gist options
  • Save Rojo/3d497b141297179e3780 to your computer and use it in GitHub Desktop.
Save Rojo/3d497b141297179e3780 to your computer and use it in GitHub Desktop.
MiniTest: Assert custom exception (ERROR)
require 'minitest/autorun'
class MyError < StandardError
end
class MyExplorationsTest << Minitest::Test
def test_raises_my_exception
proc { fail MyError }.must_raise MyError
end
end
# 1) Error:
# NoMethodError: undefined method `assert_raises' for nil:NilClass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment