diff options
Diffstat (limited to 'spec/ruby/library/matrix/real_spec.rb')
| -rw-r--r-- | spec/ruby/library/matrix/real_spec.rb | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/spec/ruby/library/matrix/real_spec.rb b/spec/ruby/library/matrix/real_spec.rb index 98da7f8a7c..4589dc22a5 100644 --- a/spec/ruby/library/matrix/real_spec.rb +++ b/spec/ruby/library/matrix/real_spec.rb @@ -1,24 +1,25 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../fixtures/classes', __FILE__) +require_relative '../../spec_helper' +require_relative 'fixtures/classes' require 'matrix' describe "Matrix#real?" do it "returns true for matrices with all real entries" do - Matrix[ [1, 2], [3, 4] ].real?.should be_true - Matrix[ [1.9, 2], [3, 4] ].real?.should be_true + Matrix[ [1, 2], [3, 4] ].real?.should == true + Matrix[ [1.9, 2], [3, 4] ].real?.should == true end it "returns true for empty matrices" do - Matrix.empty.real?.should be_true + Matrix.empty.real?.should == true end it "returns false if one element is a Complex" do - Matrix[ [Complex(1,1), 2], [3, 4] ].real?.should be_false + Matrix[ [Complex(1,1), 2], [3, 4] ].real?.should == false end - conflicts_with :CMath do + # Guard against the Mathn library + guard -> { !defined?(Math.rsqrt) } do it "returns false if one element is a Complex whose imaginary part is 0" do - Matrix[ [Complex(1,0), 2], [3, 4] ].real?.should be_false + Matrix[ [Complex(1,0), 2], [3, 4] ].real?.should == false end end end @@ -36,7 +37,7 @@ describe "Matrix#real" do describe "for a subclass of Matrix" do it "returns an instance of that subclass" do - MatrixSub.ins.real.should be_an_instance_of(MatrixSub) + MatrixSub.ins.real.should.instance_of?(MatrixSub) end end end |
