Sha256: 5c078a7830c7e1093f154bad4b245fd02e3febf49e7634145e017de3023b4259

Contents?: true

Size: 734 Bytes

Versions: 10

Compression:

Stored size: 734 Bytes

Contents

require 'spec_helper'

describe Danica::Expression::Baskara do
  describe '#to_tex' do
    it 'returns bascara tex string' do
      expect(subject.to_tex).to eq('\frac{-b \pm \sqrt{b^{2} -4 \cdot a \cdot c}}{2 \cdot a}')
    end
  end
end

describe Danica::Expression do
  let(:clazz) do
    described_class.build(:a, :b, :c) do
       (
         negative(b) + Danica::Wrapper::PlusMinus.new(
           squared_root(
             power(b, 2) - multiplication(4, a, c)
           )
         )
       ) / (number(2) * a)
    end
  end
  subject { clazz.new }

  describe 'to_tex' do
    it 'returns bascara tex string' do
      expect(subject.to_tex).to eq('\frac{-b \pm \sqrt{b^{2} -4 \cdot a \cdot c}}{2 \cdot a}')
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
danica-2.7.4 spec/integration/readme/expression_spec.rb
danica-2.7.3 spec/integration/readme/expression_spec.rb
danica-2.7.2 spec/integration/readme/expression_spec.rb
danica-2.7.1 spec/integration/readme/expression_spec.rb
danica-2.6.4 spec/integration/readme/expression_spec.rb
danica-2.6.3 spec/integration/readme/expression_spec.rb
danica-2.6.2 spec/integration/readme/expression_spec.rb
danica-2.6.1 spec/integration/readme/expression_spec.rb
danica-2.6.0 spec/integration/readme/expression_spec.rb
danica-2.5.1 spec/integration/readme/expression_spec.rb