Sha256: d0041179c6db822b6b0b4814e0719d2fa08aa52b8b3337e05444ca9f5a55cef6

Contents?: true

Size: 879 Bytes

Versions: 1

Compression:

Stored size: 879 Bytes

Contents

require 'spec_helper'

describe 'Veritas::Optimizer::Logic::Connective::Binary::RedundantLeftOperand#optimize' do
  subject { object.optimize }

  let(:klass)      { Optimizer::Logic::Connective::Binary::RedundantLeftOperand }
  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)     { klass.new(connective)                                      }

  before do
    object.operation.should be_kind_of(Logic::Connective::Binary)
  end

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

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.2 spec/unit/veritas/optimizer/logic/connective/binary/redundant_left_operand/optimize_spec.rb