diff options
Diffstat (limited to 'spec/ruby/library/matrix/vector')
5 files changed, 12 insertions, 12 deletions
diff --git a/spec/ruby/library/matrix/vector/cross_product_spec.rb b/spec/ruby/library/matrix/vector/cross_product_spec.rb index c2698ade4c..96a462c067 100644 --- a/spec/ruby/library/matrix/vector/cross_product_spec.rb +++ b/spec/ruby/library/matrix/vector/cross_product_spec.rb @@ -9,6 +9,6 @@ describe "Vector#cross_product" do it "raises an error unless both vectors have dimension 3" do -> { Vector[1, 2, 3].cross_product(Vector[0, -4]) - }.should raise_error(Vector::ErrDimensionMismatch) + }.should.raise(Vector::ErrDimensionMismatch) end end diff --git a/spec/ruby/library/matrix/vector/each2_spec.rb b/spec/ruby/library/matrix/vector/each2_spec.rb index 10d2fc404d..86e7ed75aa 100644 --- a/spec/ruby/library/matrix/vector/each2_spec.rb +++ b/spec/ruby/library/matrix/vector/each2_spec.rb @@ -8,8 +8,8 @@ describe "Vector.each2" do end it "requires one argument" do - -> { @v.each2(@v2, @v2){} }.should raise_error(ArgumentError) - -> { @v.each2(){} }.should raise_error(ArgumentError) + -> { @v.each2(@v2, @v2){} }.should.raise(ArgumentError) + -> { @v.each2(){} }.should.raise(ArgumentError) end describe "given one argument" do @@ -20,8 +20,8 @@ describe "Vector.each2" do end it "raises a DimensionMismatch error if the Vector size is different" do - -> { @v.each2(Vector[1,2]){} }.should raise_error(Vector::ErrDimensionMismatch) - -> { @v.each2(Vector[1,2,3,4]){} }.should raise_error(Vector::ErrDimensionMismatch) + -> { @v.each2(Vector[1,2]){} }.should.raise(Vector::ErrDimensionMismatch) + -> { @v.each2(Vector[1,2,3,4]){} }.should.raise(Vector::ErrDimensionMismatch) end it "yields arguments in sequence" do @@ -37,12 +37,12 @@ describe "Vector.each2" do end it "returns self when given a block" do - @v.each2(@v2){}.should equal(@v) + @v.each2(@v2){}.should.equal?(@v) end it "returns an enumerator if no block given" do enum = @v.each2(@v2) - enum.should be_an_instance_of(Enumerator) + enum.should.instance_of?(Enumerator) enum.to_a.should == [[1, 4], [2, 5], [3, 6]] end end diff --git a/spec/ruby/library/matrix/vector/eql_spec.rb b/spec/ruby/library/matrix/vector/eql_spec.rb index eb2451b550..6e2cd47b8e 100644 --- a/spec/ruby/library/matrix/vector/eql_spec.rb +++ b/spec/ruby/library/matrix/vector/eql_spec.rb @@ -7,10 +7,10 @@ describe "Vector#eql?" do end it "returns true for self" do - @vector.eql?(@vector).should be_true + @vector.eql?(@vector).should == true end it "returns false when there are a pair corresponding elements which are not equal in the sense of Kernel#eql?" do - @vector.eql?(Vector[1, 2, 3, 4, 5.0]).should be_false + @vector.eql?(Vector[1, 2, 3, 4, 5.0]).should == false end end diff --git a/spec/ruby/library/matrix/vector/inner_product_spec.rb b/spec/ruby/library/matrix/vector/inner_product_spec.rb index 1cf8771e04..79dee10833 100644 --- a/spec/ruby/library/matrix/vector/inner_product_spec.rb +++ b/spec/ruby/library/matrix/vector/inner_product_spec.rb @@ -13,7 +13,7 @@ describe "Vector#inner_product" do it "raises an error for mismatched vectors" do -> { Vector[1, 2, 3].inner_product(Vector[0, -4]) - }.should raise_error(Vector::ErrDimensionMismatch) + }.should.raise(Vector::ErrDimensionMismatch) end it "uses the conjugate of its argument" do diff --git a/spec/ruby/library/matrix/vector/normalize_spec.rb b/spec/ruby/library/matrix/vector/normalize_spec.rb index 527c9260de..bb1f046786 100644 --- a/spec/ruby/library/matrix/vector/normalize_spec.rb +++ b/spec/ruby/library/matrix/vector/normalize_spec.rb @@ -10,9 +10,9 @@ describe "Vector#normalize" do it "raises an error for zero vectors" do -> { Vector[].normalize - }.should raise_error(Vector::ZeroVectorError) + }.should.raise(Vector::ZeroVectorError) -> { Vector[0, 0, 0].normalize - }.should raise_error(Vector::ZeroVectorError) + }.should.raise(Vector::ZeroVectorError) end end |
