mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #41858 from jhawthorn/fix_build
Fix build on Ruby 3.0.1
This commit is contained in:
commit
da795a678b
1 changed files with 3 additions and 2 deletions
|
@ -111,9 +111,10 @@ class NumericalityValidationTest < ActiveRecord::TestCase
|
||||||
|
|
||||||
subject = model_class.new(virtual_decimal_number: 123.455)
|
subject = model_class.new(virtual_decimal_number: 123.455)
|
||||||
|
|
||||||
if RUBY_VERSION > "3.0.0"
|
if 123.455.to_d(5) == BigDecimal("123.46")
|
||||||
# BigDecimal's to_d behavior changed in BigDecimal 3.0.1, see https://github.com/ruby/bigdecimal/issues/70
|
# BigDecimal's to_d behavior changed in BigDecimal 3.0.1, see https://github.com/ruby/bigdecimal/issues/70
|
||||||
# TODO: replace this with a check against BigDecimal::VERSION
|
# TODO: replace this with a check against BigDecimal::VERSION, currently
|
||||||
|
# we just check the behaviour because both versions of BigDecimal report "3.0.0"
|
||||||
assert_not_predicate subject, :valid?
|
assert_not_predicate subject, :valid?
|
||||||
else
|
else
|
||||||
assert_predicate subject, :valid?
|
assert_predicate subject, :valid?
|
||||||
|
|
Loading…
Reference in a new issue