Created
January 31, 2011 01:59
-
-
Save cw4d3/803530 to your computer and use it in GitHub Desktop.
from test_about_exceptions.rb Koan
This file contains hidden or 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
| class AboutExceptions | |
| class MySpecialError < RuntimeError | |
| end | |
| def test_rescue_clause | |
| result = nil | |
| begin | |
| fail "Oops" | |
| rescue StandardError => ex | |
| result = :exception_handled | |
| end | |
| end | |
| # assert_equal __, ex.is_a?(StandardError), "Should be a Standard Error" | |
| # assert_equal __, ex.is_a?(RuntimeError), "Should be a Runtime Error" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment