Sha256: 43c85cd7063c6106ff8a9838ed4b37cf4d7a27e765cd496d18c2f529c6fdabf1

Contents?: true

Size: 676 Bytes

Versions: 7

Compression:

Stored size: 676 Bytes

Contents

require 'spec_helper'

describe Danica::Wrapper::Number do
  let(:number) do
    Danica::Wrapper::Number.new(3)
  end

  subject do
    Danica::DSL.build do
      number(3)
    end
  end

  it do
    expect(subject).to eq(number)
  end

  describe 'from basic operation' do
    let(:sum) do
      Danica::DSL.build do
        power(:x, 2) + 3
      end
    end

    let(:expected) do
      Danica::Operator::Addition.new(
        Danica::Operator::Power.new(
          Danica::Wrapper::Variable.new(:x), 
          Danica::Wrapper::Number.new(2)
        ),
        Danica::Wrapper::Number.new(3)
      )
    end

    it do
      expect(sum).to eq(expected)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
danica-2.7.4 spec/integration/readme/number_spec.rb
danica-2.7.3 spec/integration/readme/number_spec.rb
danica-2.7.2 spec/integration/readme/number_spec.rb
danica-2.7.1 spec/integration/readme/number_spec.rb
danica-2.6.4 spec/integration/readme/number_spec.rb
danica-2.6.3 spec/integration/readme/number_spec.rb
danica-2.6.2 spec/integration/readme/number_spec.rb