Permalink
Browse files

Change test for ruby 1.9 crash

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7646 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent ae16536 commit 7faeb0db0731d7846d6cf75db633dd77d918e863 @jeremy jeremy committed Sep 27, 2007
Showing with 4 additions and 6 deletions.
  1. +4 −6 activesupport/test/core_ext/enumerable_test.rb
@@ -46,18 +46,16 @@ def test_nil_sums
assert_equal 60, payments.sum { |p| p.price.to_i * 2 }
end
-
+
def test_empty_sums
assert_equal 0, [].sum
assert_equal 0, [].sum { |i| i }
assert_equal Payment.new(0), [].sum(Payment.new(0))
end
-
+
def test_index_by
payments = [ Payment.new(5), Payment.new(15), Payment.new(10) ]
- assert_equal(
- {5 => payments[0], 15 => payments[1], 10 => payments[2]},
- payments.index_by(&:price)
- )
+ assert_equal({ 5 => payments[0], 15 => payments[1], 10 => payments[2] },
+ payments.index_by { |p| p.price })
end
end

0 comments on commit 7faeb0d

Please sign in to comment.