1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-05-31 18:22:49 +02:00
parent f4502b001a
commit 34776105c8
46 changed files with 629 additions and 94 deletions

View file

@ -112,6 +112,17 @@ describe "Kernel#BigDecimal" do
neg_inf.should < 0
end
ruby_version_is "2.6" do
describe "with exception: false" do
it "returns nil for invalid strings" do
BigDecimal("invalid", exception: false).should be_nil
BigDecimal("0invalid", exception: false).should be_nil
BigDecimal("invalid0", exception: false).should be_nil
BigDecimal("0.", exception: false).should be_nil
end
end
end
describe "accepts NaN and [+-]Infinity as Float values" do
it "works without an explicit precision" do
BigDecimal(Float::NAN).should.nan?