diff options
Diffstat (limited to 'spec/ruby/core/math/hypot_spec.rb')
| -rw-r--r-- | spec/ruby/core/math/hypot_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/ruby/core/math/hypot_spec.rb b/spec/ruby/core/math/hypot_spec.rb index f693a719f3..4ab5bd4e88 100644 --- a/spec/ruby/core/math/hypot_spec.rb +++ b/spec/ruby/core/math/hypot_spec.rb @@ -1,9 +1,9 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../fixtures/classes', __FILE__) +require_relative '../../spec_helper' +require_relative 'fixtures/classes' describe "Math.hypot" do it "returns a float" do - Math.hypot(3, 4).should be_kind_of(Float) + Math.hypot(3, 4).should.is_a?(Float) end it "returns the length of the hypotenuse of a right triangle with legs given by the arguments" do @@ -16,17 +16,17 @@ describe "Math.hypot" do end it "raises a TypeError if the argument cannot be coerced with Float()" do - lambda { Math.hypot("test", "this") }.should raise_error(TypeError) + -> { Math.hypot("test", "this") }.should.raise(TypeError) end it "returns NaN given NaN" do - Math.hypot(nan_value, 0).nan?.should be_true - Math.hypot(0, nan_value).nan?.should be_true - Math.hypot(nan_value, nan_value).nan?.should be_true + Math.hypot(nan_value, 0).nan?.should == true + Math.hypot(0, nan_value).nan?.should == true + Math.hypot(nan_value, nan_value).nan?.should == true end it "raises a TypeError if the argument is nil" do - lambda { Math.hypot(nil, nil) }.should raise_error(TypeError) + -> { Math.hypot(nil, nil) }.should.raise(TypeError) end it "accepts any argument that can be coerced with Float()" do |
