mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Improving test coverage for Range#sum [#2489]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
@@ -64,9 +64,9 @@ class EnumerableTests < Test::Unit::TestCase
|
||||
def test_enumerable_sums
|
||||
assert_equal 20, (1..4).sum { |i| i * 2 }
|
||||
assert_equal 10, (1..4).sum
|
||||
assert_equal 10, (1..4.5).sum
|
||||
assert_equal 6, (1...4).sum
|
||||
assert_equal 'abc', ('a'..'c').sum
|
||||
assert_raises(NoMethodError) { 1..2.5.sum }
|
||||
end
|
||||
|
||||
def test_each_with_object
|
||||
|
||||
Reference in New Issue
Block a user