Sha256: 1593f7209f9ca20cc1e829a5f145252a8b411f55e1495430f5b6b6978c14bd64
Contents?: true
Size: 732 Bytes
Versions: 17
Compression:
Stored size: 732 Bytes
Contents
require 'spec_helper' describe Dydx::Algebra::Set::E do it{ expect(e).to eq(e) } describe '#to_s' do it{ expect(e.to_s).to eq('e') } end describe '#differentiate' do it{ expect(e.d(:x).to_s).to eq(_(0).to_s) } it{ expect((e ^ :x).d(:x).to_s).to eq('( e ^ x )') } it{ expect((e ^ (:x + :y)).d(:x).to_s).to eq('( e ^ ( x + y ) )') } end describe 'Calculate' do context 'With Fixnum' do it{ expect(e + 0).to eq(e) } it{ expect(e - 0).to eq(e) } it{ expect((e * 0).to_s).to eq('0') } it{ expect(e * 1).to eq(e) } it{ expect{(e / 0).to_s}.to raise_error(ZeroDivisionError) } it{ expect(e / 1).to eq(e) } it{ expect((e ^ 0).to_s).to eq('1') } end end end
Version data entries
17 entries across 17 versions & 1 rubygems