diff options
author | Benoit Daloze <[email protected]> | 2019-06-27 21:02:36 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2019-06-27 21:02:36 +0200 |
commit | d80e44deec77678fe2d72f94c17b2409b3e794d5 (patch) | |
tree | 612bf2313550e0982dda452f48492cc069e1c21a /spec/ruby/library/bigdecimal/BigDecimal_spec.rb | |
parent | c940397116c5aef76b1c0d05561c11d43ef596a7 (diff) |
Update to ruby/spec@8d74d49
Diffstat (limited to 'spec/ruby/library/bigdecimal/BigDecimal_spec.rb')
-rw-r--r-- | spec/ruby/library/bigdecimal/BigDecimal_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/ruby/library/bigdecimal/BigDecimal_spec.rb b/spec/ruby/library/bigdecimal/BigDecimal_spec.rb index 98b3f47703..ec38c6f113 100644 --- a/spec/ruby/library/bigdecimal/BigDecimal_spec.rb +++ b/spec/ruby/library/bigdecimal/BigDecimal_spec.rb @@ -150,8 +150,13 @@ describe "Kernel#BigDecimal" do BigDecimal("-12345.6E-1").should == -reference end - it 'raises ArgumentError when Float is used without precision' do + it "raises ArgumentError when Float is used without precision" do lambda { BigDecimal(1.0) }.should raise_error(ArgumentError) end + it "returns appropriate BigDecimal zero for signed zero" do + BigDecimal(-0.0, Float::DIG).sign.should == -1 + BigDecimal(0.0, Float::DIG).sign.should == 1 + end + end |