Sha256: 34d2875a246ce3f8c16bc0be065a493d3a7611b6caa1968a1dbb65299cb4cabb
Contents?: true
Size: 979 Bytes
Versions: 4
Compression:
Stored size: 979 Bytes
Contents
require 'spec_helper' describe Dydx do it 'has a version number' do expect(Dydx::VERSION).not_to be nil end context 'ex1' do $a = (:x ^ :n) let(:d1){ da/dx } let(:d2){ d/dx($a) } it{ expect(d1.to_s).to eq('( n * ( x ^ ( n - 1 ) ) )') } it{ expect(d2.to_s).to eq('( n * ( x ^ ( n - 1 ) ) )') } end context 'ex2' do $b = (:x ^ (:x * 2)) let(:d1){ db/dx } let(:d2){ d/dx($b) } it{ expect(d1.to_s).to eq('( ( x * 2 ) * ( x ^ ( ( x * 2 ) - 1 ) ) )') } it{ expect(d2.to_s).to eq('( ( x * 2 ) * ( x ^ ( ( x * 2 ) - 1 ) ) )') } end context 'ex3' do $c = (:t ^ 2) / 2 let(:d1){ dc/dt } let(:d2){ d/dt($c) } it{ expect(d1.to_s).to eq('t') } it{ expect(d2.to_s).to eq('t') } end context 'ex4' do $f = 2 * (e ^ (2 * :z)) let(:d1){ df/dz } let(:d2){ d/dz($f) } it{ expect(d1.to_s).to eq('( 4 * ( e ^ ( 2 * z ) ) )') } it{ expect(d2.to_s).to eq('( 4 * ( e ^ ( 2 * z ) ) )') } end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
dydx-0.0.8 | spec/dydx_spec.rb |
dydx-0.0.7 | spec/dydx_spec.rb |
dydx-0.0.6 | spec/dydx_spec.rb |
dydx-0.0.5 | spec/dydx_spec.rb |