diff options
Diffstat (limited to 'spec/ruby/core/complex/shared')
| -rw-r--r-- | spec/ruby/core/complex/shared/divide.rb | 6 | ||||
| -rw-r--r-- | spec/ruby/core/complex/shared/rect.rb | 24 |
2 files changed, 15 insertions, 15 deletions
diff --git a/spec/ruby/core/complex/shared/divide.rb b/spec/ruby/core/complex/shared/divide.rb index a60802c74c..ef79ecdf75 100644 --- a/spec/ruby/core/complex/shared/divide.rb +++ b/spec/ruby/core/complex/shared/divide.rb @@ -19,11 +19,11 @@ describe :complex_divide, shared: true do end it "raises a ZeroDivisionError when given zero" do - -> { Complex(20, 40).send(@method, 0) }.should raise_error(ZeroDivisionError) + -> { Complex(20, 40).send(@method, 0) }.should.raise(ZeroDivisionError) end it "produces Rational parts" do - Complex(5, 9).send(@method, 2).should eql(Complex(Rational(5,2), Rational(9,2))) + Complex(5, 9).send(@method, 2).should.eql?(Complex(Rational(5,2), Rational(9,2))) end end @@ -76,7 +76,7 @@ describe :complex_divide, shared: true do other = mock_numeric('other') other.should_receive(:real?).any_number_of_times.and_return(false) other.should_receive(:coerce).with(complex).and_return([5, 2]) - complex.send(@method, other).should eql(Rational(5, 2)) + complex.send(@method, other).should.eql?(Rational(5, 2)) end end end diff --git a/spec/ruby/core/complex/shared/rect.rb b/spec/ruby/core/complex/shared/rect.rb index 9f5de1ffeb..858234961b 100644 --- a/spec/ruby/core/complex/shared/rect.rb +++ b/spec/ruby/core/complex/shared/rect.rb @@ -13,7 +13,7 @@ describe :complex_rect, shared: true do it "returns an Array" do @numbers.each do |number| - number.send(@method).should be_an_instance_of(Array) + number.send(@method).should.instance_of?(Array) end end @@ -24,20 +24,20 @@ describe :complex_rect, shared: true do end it "returns the real part of self as the first element" do - @numbers.each do |number| - number.send(@method).first.should == number.real - end + @numbers.each do |number| + number.send(@method).first.should == number.real + end end it "returns the imaginary part of self as the last element" do - @numbers.each do |number| - number.send(@method).last.should == number.imaginary - end + @numbers.each do |number| + number.send(@method).last.should == number.imaginary + end end it "raises an ArgumentError if given any arguments" do @numbers.each do |number| - -> { number.send(@method, number) }.should raise_error(ArgumentError) + -> { number.send(@method, number) }.should.raise(ArgumentError) end end end @@ -57,7 +57,7 @@ describe :complex_rect_class, shared: true do it "raises TypeError" do n = mock_numeric('n') n.should_receive(:real?).any_number_of_times.and_return(false) - -> { Complex.send(@method, n) }.should raise_error(TypeError) + -> { Complex.send(@method, n) }.should.raise(TypeError) end end @@ -68,7 +68,7 @@ describe :complex_rect_class, shared: true do n2 = mock_numeric('n2') n1.should_receive(:real?).any_number_of_times.and_return(r1) n2.should_receive(:real?).any_number_of_times.and_return(r2) - -> { Complex.send(@method, n1, n2) }.should raise_error(TypeError) + -> { Complex.send(@method, n1, n2) }.should.raise(TypeError) end end end @@ -87,8 +87,8 @@ describe :complex_rect_class, shared: true do describe "passed a non-Numeric" do it "raises TypeError" do - -> { Complex.send(@method, :sym) }.should raise_error(TypeError) - -> { Complex.send(@method, 0, :sym) }.should raise_error(TypeError) + -> { Complex.send(@method, :sym) }.should.raise(TypeError) + -> { Complex.send(@method, 0, :sym) }.should.raise(TypeError) end end end |
