Sha256: 058d9bb58bbbb02f0a1ffda6c7049e71b4b55f1f3ccf293155463dbd3c781bd5

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:described_class) { Class.new(Optimizer) { include Optimizer::Function::Binary }                        }
  let(:attribute)       { Attribute::Integer.new(:id)                                                         }
  let(:left)            { attribute.include([ 1 ])                                                            }
  let(:right)           { attribute.exclude([ 2 ])                                                            }
  let(:function)        { Class.new(Veritas::Function) { include Veritas::Function::Binary }.new(left, right) }
  let(:object)          { described_class.new(function)                                                       }

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

  its(:left) { should eql(attribute.eq(1)) }

  its(:right) { should eql(attribute.ne(2)) }
end

Version data entries

4 entries across 4 versions & 1 rubygems

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