diff options
Diffstat (limited to 'spec/ruby/core/complex/fdiv_spec.rb')
| -rw-r--r-- | spec/ruby/core/complex/fdiv_spec.rb | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/spec/ruby/core/complex/fdiv_spec.rb b/spec/ruby/core/complex/fdiv_spec.rb index 68f7d1b309..fdcbc6a95d 100644 --- a/spec/ruby/core/complex/fdiv_spec.rb +++ b/spec/ruby/core/complex/fdiv_spec.rb @@ -2,44 +2,44 @@ require_relative '../../spec_helper' describe "Complex#fdiv" do it "accepts a numeric argument" do - -> { Complex(20).fdiv(2) }.should_not raise_error(TypeError) - -> { Complex(20).fdiv(2.0) }.should_not raise_error(TypeError) - -> { Complex(20).fdiv(bignum_value) }.should_not raise_error(TypeError) + -> { Complex(20).fdiv(2) }.should_not.raise(TypeError) + -> { Complex(20).fdiv(2.0) }.should_not.raise(TypeError) + -> { Complex(20).fdiv(bignum_value) }.should_not.raise(TypeError) end it "accepts a negative numeric argument" do - -> { Complex(20).fdiv(-2) }.should_not raise_error(TypeError) - -> { Complex(20).fdiv(-2.0) }.should_not raise_error(TypeError) - -> { Complex(20).fdiv(-bignum_value) }.should_not raise_error(TypeError) + -> { Complex(20).fdiv(-2) }.should_not.raise(TypeError) + -> { Complex(20).fdiv(-2.0) }.should_not.raise(TypeError) + -> { Complex(20).fdiv(-bignum_value) }.should_not.raise(TypeError) end it "raises a TypeError if passed a non-numeric argument" do - -> { Complex(20).fdiv([]) }.should raise_error(TypeError) - -> { Complex(20).fdiv(:sym) }.should raise_error(TypeError) - -> { Complex(20).fdiv('s') }.should raise_error(TypeError) + -> { Complex(20).fdiv([]) }.should.raise(TypeError) + -> { Complex(20).fdiv(:sym) }.should.raise(TypeError) + -> { Complex(20).fdiv('s') }.should.raise(TypeError) end it "sets the real part to NaN if self's real part is NaN" do - Complex(nan_value).fdiv(2).real.nan?.should be_true + Complex(nan_value).fdiv(2).real.nan?.should == true end it "sets the imaginary part to NaN if self's imaginary part is NaN" do - Complex(2, nan_value).fdiv(2).imag.nan?.should be_true + Complex(2, nan_value).fdiv(2).imag.nan?.should == true end it "sets the real and imaginary part to NaN if self's real and imaginary parts are NaN" do - Complex(nan_value, nan_value).fdiv(2).imag.nan?.should be_true - Complex(nan_value, nan_value).fdiv(2).real.nan?.should be_true + Complex(nan_value, nan_value).fdiv(2).imag.nan?.should == true + Complex(nan_value, nan_value).fdiv(2).real.nan?.should == true end it "sets the real and imaginary part to NaN if self's real part and the argument are both NaN" do - Complex(nan_value, 2).fdiv(nan_value).imag.nan?.should be_true - Complex(nan_value, 2).fdiv(nan_value).real.nan?.should be_true + Complex(nan_value, 2).fdiv(nan_value).imag.nan?.should == true + Complex(nan_value, 2).fdiv(nan_value).real.nan?.should == true end it "sets the real and imaginary part to NaN if self's real part, self's imaginary part, and the argument are NaN" do - Complex(nan_value, nan_value).fdiv(nan_value).imag.nan?.should be_true - Complex(nan_value, nan_value).fdiv(nan_value).real.nan?.should be_true + Complex(nan_value, nan_value).fdiv(nan_value).imag.nan?.should == true + Complex(nan_value, nan_value).fdiv(nan_value).real.nan?.should == true end it "sets the real part to Infinity if self's real part is Infinity" do @@ -58,8 +58,8 @@ describe "Complex#fdiv" do end it "sets the real part to NaN and the imaginary part to NaN if self's imaginary part, self's real part, and the argument are Infinity" do - Complex(infinity_value, infinity_value).fdiv(infinity_value).real.nan?.should be_true - Complex(infinity_value, infinity_value).fdiv(infinity_value).imag.nan?.should be_true + Complex(infinity_value, infinity_value).fdiv(infinity_value).real.nan?.should == true + Complex(infinity_value, infinity_value).fdiv(infinity_value).imag.nan?.should == true end end @@ -71,7 +71,7 @@ describe "Complex#fdiv with no imaginary part" do it "returns a Complex number" do @numbers.each do |real| @numbers.each do |other| - Complex(real).fdiv(other).should be_an_instance_of(Complex) + Complex(real).fdiv(other).should.instance_of?(Complex) end end end @@ -103,7 +103,7 @@ describe "Complex#fdiv with an imaginary part" do @numbers.each_with_index do |other,idx| Complex( real,@numbers[idx == 0 ? -1 : idx-1] - ).fdiv(other).should be_an_instance_of(Complex) + ).fdiv(other).should.instance_of?(Complex) end end end |
