Sha256: c02e02c9085e59ca56cf01b6f773af333e2efc0cd7aeb5646213c3f3d895d2a6

Contents?: true

Size: 650 Bytes

Versions: 5

Compression:

Stored size: 650 Bytes

Contents

require 'spec_helper'

describe Danica::Variable do
  describe '#to_f' do
    context 'when variable has no value' do
      it { expect { subject.to_f }.to raise_error(Danica::Exception::NotDefined) }
    end

    context 'when variable has value' do
      let(:value) { 100 }
      let(:subject) { described_class.new(value: value) }

      it 'returns the value' do
        expect(subject.to_f).to eq(value)
      end
    end
  end

  describe '#to_tex' do
    it_behaves_like 'a variable method to formated string', :to_tex, :latex
  end

  describe '#to_gnu' do
    it_behaves_like 'a variable method to formated string', :to_gnu, :gnu
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
danica-2.0.1 spec/lib/danica/variable_spec.rb
danica-2.0.0 spec/lib/danica/variable_spec.rb
danica-1.2.0 spec/lib/danica/variable_spec.rb
danica-1.1.0 spec/lib/danica/variable_spec.rb
danica-1.0.0 spec/lib/danica/variable_spec.rb