rails/rails — pull request #3989 by flooose (2011-12-14 21:19:33+00:00)
Title: Extend array support for assert difference

This change extends the "assert_difference" method to accept an
optional array of values corresponding to an array of expressions
passed to the method. For example:

Currently, if you want to pass an array of expressions, you can only do:

assert_difference ['Delayed::Job.count', 'SomeModel.count'], +2 do
execute_some_code
end

With this change, the numerical value can also be an array of values:

assert_difference ['Delayed::Job.count', 'SomeModel.count'], [-1, 4] do
execute_some_code
end

Then each expression would be tested against the corresponding value
in the value array.

None of the old functionality is affected.