spec/lib/algebra/formula_spec.rb in dydx-0.0.3 vs spec/lib/algebra/formula_spec.rb in dydx-0.0.4

- old
+ new

@@ -48,27 +48,10 @@ it{ expect(exponentiation.d(:x).to_s).to eq('( y * ( x ^ ( y - 1 ) ) )') } it{ expect(exponentiation.d(:y).to_s).to eq('( ( x ^ y ) * log( x ) )') } it{ expect(exponentiation.d(:z).to_s).to eq('0') } end - context 'With Symbol' 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 ) ) )') } + describe '#include?' do + it{ expect(addition.include?(:x)).to be_true } + it{ expect(addition.include?(:z)).to be_false } end - - context 'With Symbol' 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 - - $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 \ No newline at end of file