/ Published in: Ruby

A custom assertion that will allow you to pass a block to find the difference between two values.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
def assert_difference(object, method, difference=1) initial_value = object.send(method) yield assert_equal initial_value + difference, object.send(method) end
URL: http://weblog.jamisbuck.org/2007/1/19/blocks-rock
Comments
