Created
September 29, 2014 20:13
-
-
Save kerrizor/dede81f1356044b1bea3 to your computer and use it in GitHub Desktop.
assert_change and refute_change in MiniTest
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 MiniTest::Unit::TestCase | |
| def assert_change(block) | |
| before = block.call | |
| yield | |
| refute_equal before, block.call | |
| end | |
| def refute_change(block) | |
| before = block.call | |
| yield | |
| assert_equal before, block.call | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment