Skip to content

Instantly share code, notes, and snippets.

@kerrizor
Created September 29, 2014 20:13
Show Gist options
  • Save kerrizor/dede81f1356044b1bea3 to your computer and use it in GitHub Desktop.
Save kerrizor/dede81f1356044b1bea3 to your computer and use it in GitHub Desktop.
assert_change and refute_change in MiniTest
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