diff options
Diffstat (limited to 'spec/ruby/library/bigdecimal/lt_spec.rb')
| -rw-r--r-- | spec/ruby/library/bigdecimal/lt_spec.rb | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/spec/ruby/library/bigdecimal/lt_spec.rb b/spec/ruby/library/bigdecimal/lt_spec.rb index 089e7aef73..c3f3573247 100644 --- a/spec/ruby/library/bigdecimal/lt_spec.rb +++ b/spec/ruby/library/bigdecimal/lt_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 @@ -66,15 +66,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 @@ -86,11 +84,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 |
