diff options
Diffstat (limited to 'spec/ruby/core/integer/remainder_spec.rb')
| -rw-r--r-- | spec/ruby/core/integer/remainder_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/ruby/core/integer/remainder_spec.rb b/spec/ruby/core/integer/remainder_spec.rb index cd10dad6f2..deb81fb2a5 100644 --- a/spec/ruby/core/integer/remainder_spec.rb +++ b/spec/ruby/core/integer/remainder_spec.rb @@ -15,17 +15,17 @@ describe "Integer#remainder" do end it "keeps sign of self" do - 5.remainder( 3).should == 2 - 5.remainder(-3).should == 2 + 5.remainder( 3).should == 2 + 5.remainder(-3).should == 2 -5.remainder( 3).should == -2 -5.remainder(-3).should == -2 end it "raises TypeError if passed non-numeric argument" do - -> { 5.remainder("3") }.should raise_error(TypeError) - -> { 5.remainder(:"3") }.should raise_error(TypeError) - -> { 5.remainder([]) }.should raise_error(TypeError) - -> { 5.remainder(nil) }.should raise_error(TypeError) + -> { 5.remainder("3") }.should.raise(TypeError) + -> { 5.remainder(:"3") }.should.raise(TypeError) + -> { 5.remainder([]) }.should.raise(TypeError) + -> { 5.remainder(nil) }.should.raise(TypeError) end end @@ -33,19 +33,19 @@ describe "Integer#remainder" do it "returns the remainder of dividing self by other" do a = bignum_value(79) a.remainder(2).should == 1 - a.remainder(97.345).should be_close(46.5674996147722, TOLERANCE) + a.remainder(97.345).should be_close(93.1349992295444, TOLERANCE) a.remainder(bignum_value).should == 79 end it "raises a ZeroDivisionError if other is zero and not a Float" do - -> { bignum_value(66).remainder(0) }.should raise_error(ZeroDivisionError) + -> { bignum_value(66).remainder(0) }.should.raise(ZeroDivisionError) end it "does raises ZeroDivisionError if other is zero and a Float" do a = bignum_value(7) b = bignum_value(32) - -> { a.remainder(0.0) }.should raise_error(ZeroDivisionError) - -> { b.remainder(-0.0) }.should raise_error(ZeroDivisionError) + -> { a.remainder(0.0) }.should.raise(ZeroDivisionError) + -> { b.remainder(-0.0) }.should.raise(ZeroDivisionError) end end end |
