Add koan on asserting exceptions

This commit is contained in:
Matt Yoho
2010-09-21 17:12:50 -04:00
parent 3ed32b4534
commit 9b5dfb4e42
2 changed files with 16 additions and 0 deletions

View File

@@ -57,4 +57,12 @@ class AboutExceptions < EdgeCase::Koan
assert_equal __, result
end
# Sometimes, we must know about the unknown
def test_asserting_an_error_is_raised
# A do-end is a block, a topic to explore more later
assert_raise(___) do
raise MySpecialError.new("New instances can be raised directly.")
end
end
end

View File

@@ -57,4 +57,12 @@ class AboutExceptions < EdgeCase::Koan
assert_equal __(:always_run), result
end
# Sometimes, we must know about the unknown
def test_asserting_an_error_is_raised
# A do-end is a block, a topic to explore more later
assert_raise(___(MySpecialError)) do
raise MySpecialError.new("New instances can be raised directly.")
end
end
end