Sha256: 331f8228a660f52878a553628b40106b217c18e0eb595ccc4efd7658c1b92515

Contents?: true

Size: 920 Bytes

Versions: 8

Compression:

Stored size: 920 Bytes

Contents

require 'spec_helper'

describe Danica::Function::Name do
  let(:x) {  Danica::Wrapper::Variable.new(name: :x, latex: '\mu', gnu: 'u')}
  let(:subject) { described_class.new(name: :f, variables: [x]) }

  describe '#to_tex' do
    it 'returns the name of the function with tex variables' do
      expect(subject.to_tex).to eq('f(\mu)')
    end

    context 'when initializing variables from scratch' do
      let(:x) { :x }

      it 'returns the name of the function with tex variables' do
        expect(subject.to_tex).to eq('f(x)')
      end
    end
  end

  describe '#to_tex' do
    it 'returns the name of the function with tex variables' do
      expect(subject.to_gnu).to eq('f(u)')
    end

    context 'when initializing variables from scratch' do
      let(:x) { :x }

      it 'returns the name of the function with tex variables' do
        expect(subject.to_gnu).to eq('f(x)')
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
danica-2.6.4 spec/lib/danica/function/name_spec.rb
danica-2.6.3 spec/lib/danica/function/name_spec.rb
danica-2.6.2 spec/lib/danica/function/name_spec.rb
danica-2.6.1 spec/lib/danica/function/name_spec.rb
danica-2.6.0 spec/lib/danica/function/name_spec.rb
danica-2.5.1 spec/lib/danica/function/name_spec.rb
danica-2.5.0 spec/lib/danica/function/name_spec.rb
danica-2.4.4 spec/lib/danica/function/name_spec.rb