diff options
Diffstat (limited to 'spec/ruby/library/bigdecimal/lte_spec.rb')
| -rw-r--r-- | spec/ruby/library/bigdecimal/lte_spec.rb | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/spec/ruby/library/bigdecimal/lte_spec.rb b/spec/ruby/library/bigdecimal/lte_spec.rb index 5cda9842bd..7918bde88b 100644 --- a/spec/ruby/library/bigdecimal/lte_spec.rb +++ b/spec/ruby/library/bigdecimal/lte_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' require 'bigdecimal' describe "BigDecimal#<=" do @@ -17,7 +17,7 @@ describe "BigDecimal#<=" do def coerce(other) return [other, BigDecimal('123')] end - def <= (other) + def <=(other) BigDecimal('123') <= other end end @@ -72,15 +72,13 @@ describe "BigDecimal#<=" do (@infinity_neg <= @infinity).should == true end - ruby_bug "#13674", ""..."2.4" do - it "properly handles Float infinity values" do - @values.each { |val| - (val <= @float_infinity).should == true - (@float_infinity <= val).should == false - (val <= @float_infinity_neg).should == false - (@float_infinity_neg <= val).should == true - } - end + it "properly handles Float infinity values" do + @values.each { |val| + (val <= @float_infinity).should == true + (@float_infinity <= val).should == false + (val <= @float_infinity_neg).should == false + (@float_infinity_neg <= val).should == true + } end it "properly handles NaN values" do @@ -92,11 +90,11 @@ describe "BigDecimal#<=" do end it "raises an ArgumentError if the argument can't be coerced into a BigDecimal" do - lambda {@zero <= nil }.should raise_error(ArgumentError) - lambda {@infinity <= nil }.should raise_error(ArgumentError) - lambda {@infinity_neg <= nil }.should raise_error(ArgumentError) - lambda {@mixed <= nil }.should raise_error(ArgumentError) - lambda {@pos_int <= nil }.should raise_error(ArgumentError) - lambda {@neg_frac <= nil }.should raise_error(ArgumentError) + -> {@zero <= nil }.should.raise(ArgumentError) + -> {@infinity <= nil }.should.raise(ArgumentError) + -> {@infinity_neg <= nil }.should.raise(ArgumentError) + -> {@mixed <= nil }.should.raise(ArgumentError) + -> {@pos_int <= nil }.should.raise(ArgumentError) + -> {@neg_frac <= nil }.should.raise(ArgumentError) end end |
