Sha256: 6f3f116811bc0852adf0377b99f3c9d3961f9167442449ef00e9450ddd112aa3

Contents?: true

Size: 586 Bytes

Versions: 17

Compression:

Stored size: 586 Bytes

Contents

require 'spec_helper'

describe Symbol do
  describe '#to_s' do
    it{ expect(:x.to_s).to eq('x') }
  end
  describe '#differentiate' do
    it{ expect(:x.d(:x).to_s).to eq('1') }
  end
  describe 'Calculate' do
    context 'With Fixnum' do
    it{ expect(:x + 0).to eq(:x) }
    it{ expect(:x - 0).to eq(:x) }
    it{ expect((:x * 0).to_s).to eq('0') }
    it{ expect(:x * 1).to eq(:x) }
    it{ expect{(:x / 0).to_s}.to raise_error(ZeroDivisionError) }
    it{ expect(:x / 1).to eq(:x) }
    it{ expect((:x ^ 0).to_s).to eq('1') }
    it{ expect(:x ^ 1).to eq(:x) }
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

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