Created
April 30, 2012 19:33
-
-
Save levicole/2561912 to your computer and use it in GitHub Desktop.
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 TestCase | |
| class AssertionFailed < RuntimeError; end | |
| def assert(exp, message='Expected assertion to pass') | |
| unless exp | |
| raise AssertionFailed.new(message) | |
| else | |
| puts 'it passed' | |
| end | |
| end | |
| def assert_equals(actual, expected) | |
| assert actual == expected, "expected #{actual} to equal #{expected}" | |
| end | |
| end | |
| class FooTest < TestCase | |
| def assert_string_equality | |
| assert_equals "test", "poop" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment