diff options
Diffstat (limited to 'spec/ruby/core/rational/truncate_spec.rb')
| -rw-r--r-- | spec/ruby/core/rational/truncate_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/ruby/core/rational/truncate_spec.rb b/spec/ruby/core/rational/truncate_spec.rb index 728fca34ea..3614431a7f 100644 --- a/spec/ruby/core/rational/truncate_spec.rb +++ b/spec/ruby/core/rational/truncate_spec.rb @@ -7,7 +7,7 @@ describe "Rational#truncate" do describe "with no arguments (precision = 0)" do it "returns an integer" do - @rational.truncate.should be_kind_of(Integer) + @rational.truncate.should.is_a?(Integer) end it "returns the truncated value toward 0" do @@ -19,7 +19,7 @@ describe "Rational#truncate" do describe "with an explicit precision = 0" do it "returns an integer" do - @rational.truncate(0).should be_kind_of(Integer) + @rational.truncate(0).should.is_a?(Integer) end it "returns the truncated value toward 0" do @@ -31,8 +31,8 @@ describe "Rational#truncate" do describe "with a precision < 0" do it "returns an integer" do - @rational.truncate(-2).should be_kind_of(Integer) - @rational.truncate(-1).should be_kind_of(Integer) + @rational.truncate(-2).should.is_a?(Integer) + @rational.truncate(-1).should.is_a?(Integer) end it "moves the truncation point n decimal places left" do @@ -44,8 +44,8 @@ describe "Rational#truncate" do describe "with a precision > 0" do it "returns a Rational" do - @rational.truncate(1).should be_kind_of(Rational) - @rational.truncate(2).should be_kind_of(Rational) + @rational.truncate(1).should.is_a?(Rational) + @rational.truncate(2).should.is_a?(Rational) end it "moves the truncation point n decimal places right" do @@ -57,15 +57,15 @@ describe "Rational#truncate" do describe "with an invalid value for precision" do it "raises a TypeError" do - -> { @rational.truncate(nil) }.should raise_error(TypeError, "not an integer") - -> { @rational.truncate(1.0) }.should raise_error(TypeError, "not an integer") - -> { @rational.truncate('') }.should raise_error(TypeError, "not an integer") + -> { @rational.truncate(nil) }.should.raise(TypeError, "not an integer") + -> { @rational.truncate(1.0) }.should.raise(TypeError, "not an integer") + -> { @rational.truncate('') }.should.raise(TypeError, "not an integer") end it "does not call to_int on the argument" do object = Object.new object.should_not_receive(:to_int) - -> { @rational.truncate(object) }.should raise_error(TypeError, "not an integer") + -> { @rational.truncate(object) }.should.raise(TypeError, "not an integer") end end end |
