/ Published in: Ruby
URL: http://weblog.jamisbuck.org/2007/1/19/blocks-rock
A custom assertion that will allow you to pass a block to find the difference between two values.
Expand |
Embed | Plain Text
def assert_difference(object, method, difference=1) initial_value = object.send(method) yield assert_equal initial_value + difference, object.send(method) end
You need to login to post a comment.
