Sha256: be9ecb22e11d72e6a5ef891bf0f42b563712c39ed8c7f8c23fe1bb1febb37396

Contents?: true

Size: 579 Bytes

Versions: 5

Compression:

Stored size: 579 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Function::Binary::ConstantOperands, '#optimize' do
  subject { object.optimize }

  let(:described_class) { Class.new(Optimizer) { include Optimizer::Function::Binary } }
  let(:function)        { Function::Numeric::Addition.new(2, 2)                        }
  let(:object)          { described_class.new(function)                                }

  before do
    described_class.class_eval { include Optimizer::Function::Binary::ConstantOperands }
    object.should be_optimizable
  end

  it { should be(4) }
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
axiom-optimizer-0.1.0 spec/unit/axiom/optimizer/function/binary/constant_operands/optimize_spec.rb
veritas-optimizer-0.0.7 spec/unit/veritas/optimizer/function/binary/constant_operands/optimize_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/function/binary/constant_operands/optimize_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/function/binary/constant_operands/optimize_spec.rb
veritas-optimizer-0.0.4 spec/unit/veritas/optimizer/function/binary/constant_operands/optimize_spec.rb