mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix NumericData.average test on ruby 2.6
This commit is contained in:
parent
e7717ec7a0
commit
89b4612ffc
1 changed files with 6 additions and 2 deletions
|
@ -57,8 +57,12 @@ class CalculationsTest < ActiveRecord::TestCase
|
|||
assert_equal 3, value
|
||||
end
|
||||
|
||||
def test_should_return_nil_as_average
|
||||
assert_nil NumericData.average(:bank_balance)
|
||||
def test_should_return_nil_to_d_as_average
|
||||
if nil.respond_to?(:to_d)
|
||||
assert_equal BigDecimal(0), NumericData.average(:bank_balance)
|
||||
else
|
||||
assert_nil NumericData.average(:bank_balance)
|
||||
end
|
||||
end
|
||||
|
||||
def test_should_get_maximum_of_field
|
||||
|
|
Loading…
Reference in a new issue