Sha256: 043b09c36ad895ceaad4387377321b7c6dc83cbcc8a539819af8ef335162face

Contents?: true

Size: 647 Bytes

Versions: 4

Compression:

Stored size: 647 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:attribute)  { Attribute::Integer.new(:id)     }
  let(:left)       { attribute.include([ 1 ])        }
  let(:right)      { attribute.exclude([ 2 ])        }
  let(:connective) { left.and(right).and(right)      }
  let(:object)     { described_class.new(connective) }

  before do
    object.should be_optimizable
  end

  it { should be_kind_of(Function::Connective::Conjunction) }

  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/connective/binary/redundant_left_operand/optimize_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/function/connective/binary/redundant_left_operand/optimize_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/function/connective/binary/redundant_left_operand/optimize_spec.rb
veritas-optimizer-0.0.4 spec/unit/veritas/optimizer/function/connective/binary/redundant_left_operand/optimize_spec.rb