diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-09-29 21:29:34 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-09-29 21:29:34 +0000 |
commit | 85a08bd99e4b2f8992c28d1956b693e559b79e01 (patch) | |
tree | 4084ee2ef2e6eb30f5db257d7463e2f887ba143e /activesupport/lib | |
parent | 8f68804fba5ac9e3c8ed0b67ef384c888b03a56b (diff) | |
download | rails-85a08bd99e4b2f8992c28d1956b693e559b79e01.tar.gz rails-85a08bd99e4b2f8992c28d1956b693e559b79e01.tar.bz2 rails-85a08bd99e4b2f8992c28d1956b693e559b79e01.zip |
Test::Unit#assert_difference Ruby 1.9 compat
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7679 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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| |