Sha256: abb0019a4685732dc68a21cd47628bb00078f9d0b7eb5f2fb624690e24b4223c

Contents?: true

Size: 948 Bytes

Versions: 5

Compression:

Stored size: 948 Bytes

Contents

require 'spec_helper'

describe 'integration of product' do
  describe 'of number and sum' do
    subject do
      Danica::Product.new(
        3, Danica::Sum.new(2, 4)
      )
    end

    describe '#to_gnu' do
      it 'returns the correct string' do
        expect(subject.to_gnu).to eq('3 * (2 + 4)')
      end
    end

    describe '#to_gnu' do
      it 'returns the correct string' do
        expect(subject.to_tex).to eq('3 \cdot \left(2 + 4\right)')
      end
    end
  end

  describe 'of sums' do
    subject do
      Danica::Product.new(
        Danica::Sum.new(1,2),
        Danica::Sum.new(3,4)
      )
    end

    describe '#to_gnu' do
      it 'returns the correct string' do
        expect(subject.to_gnu).to eq('(1 + 2) * (3 + 4)')
      end
    end

    describe '#to_tex' do
      it 'returns the correct string' do
        expect(subject.to_tex).to eq('\left(1 + 2\right) \cdot \left(3 + 4\right)')
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
danica-2.2.1 spec/integration/product_spec.rb
danica-2.2.0 spec/integration/product_spec.rb
danica-2.1.1 spec/integration/product_spec.rb
danica-2.1.0 spec/integration/product_spec.rb
danica-2.0.6 spec/integration/product_spec.rb