Sha256: 89de855cc6613497cc5532831a928197a8f083bd14f52dcca54892d4bc38a023

Contents?: true

Size: 1.33 KB

Versions: 2

Compression:

Stored size: 1.33 KB

Contents

require 'spec_helper.rb'

describe Daru::Vector do
  before :each do
    @dv1 = Daru::Vector.new [1,2,3,4], name: :boozy, index: [:bud, :kf, :henie, :corona]
    @dv2 = Daru::Vector.new [1,2,3,4], name: :mayer, index: [:obi, :wan, :kf, :corona]
  end

  context "#+" do
    it "adds matching indexes of the other vector" do
      expect(@dv1 + @dv2).to eq(Daru::Vector.new([5, 8], name: :boozy, index: [:kf, :corona]))
    end

    it "adds number to each element of the entire vector" do
      expect(@dv1 + 5).to eq(Daru::Vector.new [6,7,8,9], name: :boozy, index: [:bud, :kf, :henie, :corona])
    end
  end

  context "#-" do
    it "subtracts matching indexes of the other vector" do
      expect(@dv1 - @dv2).to eq(Daru::Vector.new([-1,0], name: :boozy, index: [:kf, :corona]))
    end

    it "subtracts number from each element of the entire vector" do
      expect(@dv1 - 5).to eq(Daru::Vector.new [-4,-3,-2,-1], name: :boozy, index: [:bud, :kf, :henie, :corona])
    end
  end

  context "#*"
    it "multiplies matching indexes of the other vector" do

    end

    it "multiplies number to each element of the entire vector" do
      
    end
  end

  context "#\/" do
    it "divides matching indexes of the other vector" do

    end

    it "divides number from each element of the entire vector" do
      
    end
  end

  context "#%" do

  end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
daru-0.0.4 spec/math/arithmetic/vector_spec.rb
daru-0.0.3.1 spec/math/arithmetic/vector_spec.rb