Sha256: 89d3f30a547738facbafeb5ebdc36eeadaebac4dc51fbb04470b56929b5e34a8

Contents?: true

Size: 1.15 KB

Versions: 10

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe Danica::Operator::Addition do
  subject { described_class.new(10, 2) }

  it 'initializes from array' do
    expect do
      described_class.new(10, 2)
    end.not_to raise_error
  end

  it_behaves_like 'an object that respond to basic_methods'

  it_behaves_like 'an object with basic operation', ignore: %i(+ -)
  it_behaves_like 'an object with + operation' do
    let(:subject_included) { 10 }

    context 'when other is also a addition' do
      let(:other) { described_class.new(200, 5) }

      it 'includes the addition parcels' do
        expect(result).to include(200)
      end
    end
  end
  it_behaves_like 'an object with - operation' do
    let(:subject_included) { 10 }
  end

  it_behaves_like 'a operator that joins many variables with same operation', {
    calculated: 10,
    numeric_variables: [ 1.5, 3.0, 3.5 ],
    tex: {
      string_expected: 'X1 + X2 + X3 + X4',
      integer_expected: '1.5 + 3 + X3 + X4',
      float_expected: '1.5 + 3 + 3.5 + X4'
    },
    gnu: {
      string_expected: 'X1 + X2 + X3 + X4',
      integer_expected: '1.5 + 3 + X3 + X4',
      float_expected: '1.5 + 3 + 3.5 + X4'
    }
  }
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
danica-2.7.1 spec/lib/danica/operator/addition_spec.rb
danica-2.6.4 spec/lib/danica/operator/addition_spec.rb
danica-2.6.3 spec/lib/danica/operator/addition_spec.rb
danica-2.6.2 spec/lib/danica/operator/addition_spec.rb
danica-2.6.1 spec/lib/danica/operator/addition_spec.rb
danica-2.6.0 spec/lib/danica/operator/addition_spec.rb
danica-2.5.1 spec/lib/danica/operator/addition_spec.rb
danica-2.5.0 spec/lib/danica/operator/addition_spec.rb
danica-2.4.4 spec/lib/danica/operator/addition_spec.rb
danica-2.4.3 spec/lib/danica/operator/addition_spec.rb