summaryrefslogtreecommitdiff
path: root/spec/ruby/library/matrix/shared
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/matrix/shared')
-rw-r--r--spec/ruby/library/matrix/shared/collect.rb6
-rw-r--r--spec/ruby/library/matrix/shared/conjugate.rb2
-rw-r--r--spec/ruby/library/matrix/shared/determinant.rb4
-rw-r--r--spec/ruby/library/matrix/shared/equal_value.rb20
-rw-r--r--spec/ruby/library/matrix/shared/identity.rb4
-rw-r--r--spec/ruby/library/matrix/shared/imaginary.rb2
-rw-r--r--spec/ruby/library/matrix/shared/inverse.rb6
-rw-r--r--spec/ruby/library/matrix/shared/rectangular.rb2
-rw-r--r--spec/ruby/library/matrix/shared/trace.rb2
-rw-r--r--spec/ruby/library/matrix/shared/transpose.rb2
10 files changed, 25 insertions, 25 deletions
diff --git a/spec/ruby/library/matrix/shared/collect.rb b/spec/ruby/library/matrix/shared/collect.rb
index 852f7fd6cf..3a4dbe3a36 100644
--- a/spec/ruby/library/matrix/shared/collect.rb
+++ b/spec/ruby/library/matrix/shared/collect.rb
@@ -7,7 +7,7 @@ describe :collect, shared: true do
end
it "returns an instance of Matrix" do
- @m.send(@method){|n| n * 2 }.should be_kind_of(Matrix)
+ @m.send(@method){|n| n * 2 }.should.is_a?(Matrix)
end
it "returns a Matrix where each element is the result of the block" do
@@ -15,12 +15,12 @@ describe :collect, shared: true do
end
it "returns an enumerator if no block is given" do
- @m.send(@method).should be_an_instance_of(Enumerator)
+ @m.send(@method).should.instance_of?(Enumerator)
end
describe "for a subclass of Matrix" do
it "returns an instance of that subclass" do
- MatrixSub.ins.send(@method){1}.should be_an_instance_of(MatrixSub)
+ MatrixSub.ins.send(@method){1}.should.instance_of?(MatrixSub)
end
end
end
diff --git a/spec/ruby/library/matrix/shared/conjugate.rb b/spec/ruby/library/matrix/shared/conjugate.rb
index d87658f855..ffdf5ebca1 100644
--- a/spec/ruby/library/matrix/shared/conjugate.rb
+++ b/spec/ruby/library/matrix/shared/conjugate.rb
@@ -14,7 +14,7 @@ describe :matrix_conjugate, shared: true do
describe "for a subclass of Matrix" do
it "returns an instance of that subclass" do
- MatrixSub.ins.send(@method).should be_an_instance_of(MatrixSub)
+ MatrixSub.ins.send(@method).should.instance_of?(MatrixSub)
end
end
end
diff --git a/spec/ruby/library/matrix/shared/determinant.rb b/spec/ruby/library/matrix/shared/determinant.rb
index 9e0528c24b..b7c86393ba 100644
--- a/spec/ruby/library/matrix/shared/determinant.rb
+++ b/spec/ruby/library/matrix/shared/determinant.rb
@@ -29,10 +29,10 @@ describe :determinant, shared: true do
it "raises an error for rectangular matrices" do
-> {
Matrix[[1], [2], [3]].send(@method)
- }.should raise_error(Matrix::ErrDimensionMismatch)
+ }.should.raise(Matrix::ErrDimensionMismatch)
-> {
Matrix.empty(3,0).send(@method)
- }.should raise_error(Matrix::ErrDimensionMismatch)
+ }.should.raise(Matrix::ErrDimensionMismatch)
end
end
diff --git a/spec/ruby/library/matrix/shared/equal_value.rb b/spec/ruby/library/matrix/shared/equal_value.rb
index 2b2311d49e..9bc6ed908b 100644
--- a/spec/ruby/library/matrix/shared/equal_value.rb
+++ b/spec/ruby/library/matrix/shared/equal_value.rb
@@ -7,27 +7,27 @@ describe :equal, shared: true do
end
it "returns true for self" do
- @matrix.send(@method, @matrix).should be_true
+ @matrix.send(@method, @matrix).should == true
end
it "returns true for equal matrices" do
- @matrix.send(@method, Matrix[ [1, 2, 3, 4, 5], [2, 3, 4, 5, 6] ]).should be_true
+ @matrix.send(@method, Matrix[ [1, 2, 3, 4, 5], [2, 3, 4, 5, 6] ]).should == true
end
it "returns false for different matrices" do
- @matrix.send(@method, Matrix[ [42, 2, 3, 4, 5], [2, 3, 4, 5, 6] ]).should be_false
- @matrix.send(@method, Matrix[ [1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6, 7] ]).should be_false
- @matrix.send(@method, Matrix[ [1, 2, 3], [2, 3, 4] ]).should be_false
+ @matrix.send(@method, Matrix[ [42, 2, 3, 4, 5], [2, 3, 4, 5, 6] ]).should == false
+ @matrix.send(@method, Matrix[ [1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6, 7] ]).should == false
+ @matrix.send(@method, Matrix[ [1, 2, 3], [2, 3, 4] ]).should == false
end
it "returns false for different empty matrices" do
- Matrix.empty(42, 0).send(@method, Matrix.empty(6, 0)).should be_false
- Matrix.empty(0, 42).send(@method, Matrix.empty(0, 6)).should be_false
- Matrix.empty(0, 0).send(@method, Matrix.empty(6, 0)).should be_false
- Matrix.empty(0, 0).send(@method, Matrix.empty(0, 6)).should be_false
+ Matrix.empty(42, 0).send(@method, Matrix.empty(6, 0)).should == false
+ Matrix.empty(0, 42).send(@method, Matrix.empty(0, 6)).should == false
+ Matrix.empty(0, 0).send(@method, Matrix.empty(6, 0)).should == false
+ Matrix.empty(0, 0).send(@method, Matrix.empty(0, 6)).should == false
end
it "doesn't distinguish on subclasses" do
- MatrixSub.ins.send(@method, Matrix.I(2)).should be_true
+ MatrixSub.ins.send(@method, Matrix.I(2)).should == true
end
end
diff --git a/spec/ruby/library/matrix/shared/identity.rb b/spec/ruby/library/matrix/shared/identity.rb
index 114f86e7b0..df957b5a75 100644
--- a/spec/ruby/library/matrix/shared/identity.rb
+++ b/spec/ruby/library/matrix/shared/identity.rb
@@ -3,7 +3,7 @@ require 'matrix'
describe :matrix_identity, shared: true do
it "returns a Matrix" do
- Matrix.send(@method, 2).should be_kind_of(Matrix)
+ Matrix.send(@method, 2).should.is_a?(Matrix)
end
it "returns a n x n identity matrix" do
@@ -13,7 +13,7 @@ describe :matrix_identity, shared: true do
describe "for a subclass of Matrix" do
it "returns an instance of that subclass" do
- MatrixSub.send(@method, 2).should be_an_instance_of(MatrixSub)
+ MatrixSub.send(@method, 2).should.instance_of?(MatrixSub)
end
end
end
diff --git a/spec/ruby/library/matrix/shared/imaginary.rb b/spec/ruby/library/matrix/shared/imaginary.rb
index d28ecc69f1..16615213a2 100644
--- a/spec/ruby/library/matrix/shared/imaginary.rb
+++ b/spec/ruby/library/matrix/shared/imaginary.rb
@@ -14,7 +14,7 @@ describe :matrix_imaginary, shared: true do
describe "for a subclass of Matrix" do
it "returns an instance of that subclass" do
- MatrixSub.ins.send(@method).should be_an_instance_of(MatrixSub)
+ MatrixSub.ins.send(@method).should.instance_of?(MatrixSub)
end
end
end
diff --git a/spec/ruby/library/matrix/shared/inverse.rb b/spec/ruby/library/matrix/shared/inverse.rb
index c8a6b90da5..ac463cf680 100644
--- a/spec/ruby/library/matrix/shared/inverse.rb
+++ b/spec/ruby/library/matrix/shared/inverse.rb
@@ -4,7 +4,7 @@ require 'matrix'
describe :inverse, shared: true do
it "returns a Matrix" do
- Matrix[ [1,2], [2,1] ].send(@method).should be_an_instance_of(Matrix)
+ Matrix[ [1,2], [2,1] ].send(@method).should.instance_of?(Matrix)
end
it "returns the inverse of the Matrix" do
@@ -27,12 +27,12 @@ describe :inverse, shared: true do
it "raises a ErrDimensionMismatch if the Matrix is not square" do
->{
Matrix[ [1,2,3], [1,2,3] ].send(@method)
- }.should raise_error(Matrix::ErrDimensionMismatch)
+ }.should.raise(Matrix::ErrDimensionMismatch)
end
describe "for a subclass of Matrix" do
it "returns an instance of that subclass" do
- MatrixSub.ins.send(@method).should be_an_instance_of(MatrixSub)
+ MatrixSub.ins.send(@method).should.instance_of?(MatrixSub)
end
end
end
diff --git a/spec/ruby/library/matrix/shared/rectangular.rb b/spec/ruby/library/matrix/shared/rectangular.rb
index 3d9a0dfe8a..0229e614c6 100644
--- a/spec/ruby/library/matrix/shared/rectangular.rb
+++ b/spec/ruby/library/matrix/shared/rectangular.rb
@@ -12,7 +12,7 @@ describe :matrix_rectangular, shared: true do
describe "for a subclass of Matrix" do
it "returns instances of that subclass" do
- MatrixSub.ins.send(@method).each{|m| m.should be_an_instance_of(MatrixSub) }
+ MatrixSub.ins.send(@method).each{|m| m.should.instance_of?(MatrixSub) }
end
end
end
diff --git a/spec/ruby/library/matrix/shared/trace.rb b/spec/ruby/library/matrix/shared/trace.rb
index 57b89863f8..c4a5491b22 100644
--- a/spec/ruby/library/matrix/shared/trace.rb
+++ b/spec/ruby/library/matrix/shared/trace.rb
@@ -6,7 +6,7 @@ describe :trace, shared: true do
end
it "returns the sum of diagonal elements in a rectangular Matrix" do
- ->{ Matrix[[1,2,3], [4,5,6]].trace}.should raise_error(Matrix::ErrDimensionMismatch)
+ ->{ Matrix[[1,2,3], [4,5,6]].trace}.should.raise(Matrix::ErrDimensionMismatch)
end
end
diff --git a/spec/ruby/library/matrix/shared/transpose.rb b/spec/ruby/library/matrix/shared/transpose.rb
index 89b1d025be..a0b495359b 100644
--- a/spec/ruby/library/matrix/shared/transpose.rb
+++ b/spec/ruby/library/matrix/shared/transpose.rb
@@ -13,7 +13,7 @@ describe :matrix_transpose, shared: true do
describe "for a subclass of Matrix" do
it "returns an instance of that subclass" do
- MatrixSub.ins.send(@method).should be_an_instance_of(MatrixSub)
+ MatrixSub.ins.send(@method).should.instance_of?(MatrixSub)
end
end
end