Sha256: 661484004c2c2a21f6f54df2c6377c73b1a62517361f5203b075bec04fe0a3f3

Contents?: true

Size: 621 Bytes

Versions: 17

Compression:

Stored size: 621 Bytes

Contents

require 'spec_helper'

describe Dydx::Algebra::Set::Pi do
  it{ expect(pi).to eq(pi) }

  describe '#to_s' do
    it{ expect(pi.to_s).to eq('pi') }
  end

  describe '#differentiate' do
    it{ expect(pi.d(:x).to_s).to eq(_(0).to_s) }
  end

  describe 'Calculate' do
    context 'With Fixnum' do
      it{ expect(pi + 0).to eq(pi) }
      it{ expect(pi - 0).to eq(pi) }
      it{ expect((pi * 0).to_s).to eq('0') }
      it{ expect(pi * 1).to eq(pi) }
      it{ expect{(pi / 0).to_s}.to raise_error(ZeroDivisionError) }
      it{ expect(pi / 1).to eq(pi) }
      it{ expect((pi ^ 0).to_s).to eq('1') }
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
dydx-0.1.31 spec/lib/algebra/set/pi_spec.rb
dydx-0.1.3 spec/lib/algebra/set/pi_spec.rb
dydx-0.1.29 spec/lib/algebra/set/pi_spec.rb
dydx-0.1.28 spec/lib/algebra/set/pi_spec.rb
dydx-0.1.25 spec/lib/algebra/set/pi_spec.rb
dydx-0.1.2 spec/lib/algebra/set/pi_spec.rb
dydx-0.1.1 spec/lib/algebra/set/pi_spec.rb
dydx-0.1.0 spec/lib/algebra/set/pi_spec.rb
dydx-0.0.9 spec/lib/algebra/set/pi_spec.rb
dydx-0.0.8 spec/lib/algebra/set/pi_spec.rb
dydx-0.0.7 spec/lib/algebra/set/pi_spec.rb
dydx-0.0.6 spec/lib/algebra/set/pi_spec.rb
dydx-0.0.5 spec/lib/algebra/set/pi_spec.rb
dydx-0.0.4 spec/lib/algebra/set/pi_spec.rb
dydx-0.0.3 spec/lib/algebra/set/pi_spec.rb
dydx-0.0.2 spec/lib/algebra/set/pi_spec.rb
dydx-0.0.1 spec/lib/algebra/set/pi_spec.rb