Sha256: 4694744cb80d1c895856988ea4f1a471671f4efc7c48adb23a042d48c7ef08ff

Contents?: true

Size: 985 Bytes

Versions: 4

Compression:

Stored size: 985 Bytes

Contents

require 'spec_helper'

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

  it_behaves_like 'an object that respond to basic_methods'

  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_gnu' 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

4 entries across 4 versions & 1 rubygems

Version Path
danica-2.7.4 spec/lib/danica/function/name_spec.rb
danica-2.7.3 spec/lib/danica/function/name_spec.rb
danica-2.7.2 spec/lib/danica/function/name_spec.rb
danica-2.7.1 spec/lib/danica/function/name_spec.rb