Sha256: 5968ffdd34beb1ac9e431c59412cbd14e4d6b1354693ed3c33bd0fd8fdf52a53

Contents?: true

Size: 568 Bytes

Versions: 3

Compression:

Stored size: 568 Bytes

Contents

require 'spec_helper'

describe 'formatting' do
  subject do
    value = 1 / 3.0
    Danica.build(:x) do
      x + value
    end
  end

  describe '#to_tex' do
    it 'formats the output' do
      expect(subject.to_tex(decimals: 3)).to eq('x + 0.333')
    end
  end
end

describe Danica::Formatted do
  let(:expression) do
    value = 1 / 3.0
    Danica.build(:x) do
      x + value
    end
  end
  subject do
    expression.tex(decimals: 3)
  end

  describe '#to_tex' do
    it 'formats the output' do
      expect(subject.to_s).to eq('x + 0.333')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
danica-2.7.4 spec/integration/readme/formatting_spec.rb
danica-2.7.3 spec/integration/readme/formatting_spec.rb
danica-2.7.2 spec/integration/readme/formatting_spec.rb