diff options
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/test/difference.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/test/difference.rb b/activesupport/lib/active_support/core_ext/test/difference.rb index 36fe8b166e..3d75809c69 100644 --- a/activesupport/lib/active_support/core_ext/test/difference.rb +++ b/activesupport/lib/active_support/core_ext/test/difference.rb @@ -32,8 +32,8 @@ module Test #:nodoc: # post :delete, :id => ... # end def assert_difference(expressions, difference = 1, message = nil, &block) - expression_evaluations = [expressions].flatten.collect{|expression| lambda { eval(expression, block.binding) } } - + expression_evaluations = Array(expressions).collect{ |expression| lambda { eval(expression, block.send!(:binding)) } } + original_values = expression_evaluations.inject([]) { |memo, expression| memo << expression.call } yield expression_evaluations.each_with_index do |expression, i| |