Sha256: 94b23bba0cbfaa5b926fb693b8cfb385352f5e35846403a1b35c4787eaee3ae8

Contents?: true

Size: 883 Bytes

Versions: 3

Compression:

Stored size: 883 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Danica::Wrapper::Number do
  subject { described_class.new(value) }

  let(:value) { 10 }

  it_behaves_like 'an object that respond to basic_methods'

  it_behaves_like 'an object with basic operation'

  describe '#valued?' do
    context 'when value is present' do
      it { expect(subject).to be_valued }
    end

    context 'when value is not present' do
      let(:value) { false }

      it { expect(subject).not_to be_valued }
    end
  end

  describe '#to_f' do
    it 'returns the float of value' do
      expect(subject.to_f).to eq(10)
    end

    it { expect(subject.to_f).to be_a(Float) }
  end

  describe '#to_tex' do
    it_behaves_like 'a method that display the numeric value', :to_tex
  end

  describe '#to_gnu' do
    it_behaves_like 'a method that display the numeric value', :to_gnu
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
danica-2.7.7 spec/lib/danica/wrapper/number_spec.rb
danica-2.7.6 spec/lib/danica/wrapper/number_spec.rb
danica-2.7.5 spec/lib/danica/wrapper/number_spec.rb