Last active
August 29, 2015 14:27
-
-
Save Rojo/3d497b141297179e3780 to your computer and use it in GitHub Desktop.
MiniTest: Assert custom exception (ERROR)
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
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