summaryrefslogtreecommitdiff
path: root/spec/ruby/library/matrix
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/matrix')
-rw-r--r--spec/ruby/library/matrix/normal_spec.rb6
-rw-r--r--spec/ruby/library/matrix/orthogonal_spec.rb6
-rw-r--r--spec/ruby/library/matrix/unitary_spec.rb10
-rw-r--r--spec/ruby/library/matrix/zero_spec.rb10
4 files changed, 16 insertions, 16 deletions
diff --git a/spec/ruby/library/matrix/normal_spec.rb b/spec/ruby/library/matrix/normal_spec.rb
index ebd73aaf40..a9e6c645fa 100644
--- a/spec/ruby/library/matrix/normal_spec.rb
+++ b/spec/ruby/library/matrix/normal_spec.rb
@@ -3,12 +3,12 @@ require 'matrix'
describe "Matrix.normal?" do
# it "returns false for non normal matrices" do
- # Matrix[[0, 1], [1, 2]].normal?.should == false
+ # Matrix[[0, 1], [1, 2]].should_not.normal?
# end
it "returns true for normal matrices" do
- Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].normal?.should == true
- Matrix[[0, Complex(0, 2)], [Complex(0, -2), 0]].normal?.should == true
+ Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].should.normal?
+ Matrix[[0, Complex(0, 2)], [Complex(0, -2), 0]].should.normal?
end
it "raises an error for rectangular matrices" do
diff --git a/spec/ruby/library/matrix/orthogonal_spec.rb b/spec/ruby/library/matrix/orthogonal_spec.rb
index 07b098a58d..26afe89ff0 100644
--- a/spec/ruby/library/matrix/orthogonal_spec.rb
+++ b/spec/ruby/library/matrix/orthogonal_spec.rb
@@ -3,12 +3,12 @@ require 'matrix'
describe "Matrix.orthogonal?" do
it "returns false for non orthogonal matrices" do
- Matrix[[0, 1], [1, 2]].orthogonal?.should == false
- Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].orthogonal?.should == false
+ Matrix[[0, 1], [1, 2]].should_not.orthogonal?
+ Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].should_not.orthogonal?
end
it "returns true for orthogonal matrices" do
- Matrix[[0, 1], [1, 0]].orthogonal?.should == true
+ Matrix[[0, 1], [1, 0]].should.orthogonal?
end
it "raises an error for rectangular matrices" do
diff --git a/spec/ruby/library/matrix/unitary_spec.rb b/spec/ruby/library/matrix/unitary_spec.rb
index c52f9d97d9..af4b2bb442 100644
--- a/spec/ruby/library/matrix/unitary_spec.rb
+++ b/spec/ruby/library/matrix/unitary_spec.rb
@@ -3,18 +3,18 @@ require 'matrix'
describe "Matrix.unitary?" do
it "returns false for non unitary matrices" do
- Matrix[[0, 1], [1, 2]].unitary?.should == false
- Matrix[[0, Complex(0, 2)], [Complex(0, 2), 0]].unitary?.should == false
- Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].unitary?.should == false
+ Matrix[[0, 1], [1, 2]].should_not.unitary?
+ Matrix[[0, Complex(0, 2)], [Complex(0, 2), 0]].should_not.unitary?
+ Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].should_not.unitary?
end
it "returns true for unitary matrices" do
- Matrix[[0, Complex(0, 1)], [Complex(0, 1), 0]].unitary?.should == true
+ Matrix[[0, Complex(0, 1)], [Complex(0, 1), 0]].should.unitary?
end
version_is((Matrix::const_defined?(:VERSION) ? Matrix::VERSION : "0.1.0"), "0.3.0") do
it "returns true for unitary matrices with a Complex and a negative #imag" do
- Matrix[[0, Complex(0, 1)], [Complex(0, -1), 0]].unitary?.should == true
+ Matrix[[0, Complex(0, 1)], [Complex(0, -1), 0]].should.unitary?
end
end
diff --git a/spec/ruby/library/matrix/zero_spec.rb b/spec/ruby/library/matrix/zero_spec.rb
index 643c57acba..68e8567c26 100644
--- a/spec/ruby/library/matrix/zero_spec.rb
+++ b/spec/ruby/library/matrix/zero_spec.rb
@@ -37,16 +37,16 @@ end
describe "Matrix.zero?" do
it "returns true for empty matrices" do
- Matrix.empty.zero?.should == true
- Matrix.empty(3,0).zero?.should == true
- Matrix.empty(0,3).zero?.should == true
+ Matrix.empty.should.zero?
+ Matrix.empty(3,0).should.zero?
+ Matrix.empty(0,3).should.zero?
end
it "returns true for matrices with zero entries" do
- Matrix.zero(2,3).zero?.should == true
+ Matrix.zero(2,3).should.zero?
end
it "returns false for matrices with non zero entries" do
- Matrix[[1]].zero?.should == false
+ Matrix[[1]].should_not.zero?
end
end