Sha256: b85a5675c32fa2771f79152f9e6ef68809a4034fd7400a63764a6b629a29b56c

Contents?: true

Size: 927 Bytes

Versions: 2

Compression:

Stored size: 927 Bytes

Contents

require 'spec_helper'

describe 'Veritas::Optimizer::Logic::Connective::Disjunction::OptimizableToInclusion#optimizable?' do
  subject { object.optimizable? }

  let(:klass)      { Optimizer::Logic::Connective::Disjunction::OptimizableToInclusion }
  let(:attribute)  { Attribute::Integer.new(:id)                                       }
  let(:connective) { left.or(right)                                                    }
  let(:object)     { klass.new(connective)                                             }

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

  context 'when the operands are optimizable' do
    let(:left)  { attribute.eq(2) }
    let(:right) { attribute.eq(1) }

    it { should be(true) }
  end

  context 'when the operands are not optimizable' do
    let(:left)  { attribute.ne(1) }
    let(:right) { attribute.eq(2) }

    it { should be(false) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
veritas-0.0.2 spec/unit/veritas/optimizer/logic/connective/disjunction/optimizable_to_inclusion/optimizable_spec.rb
veritas-0.0.1 spec/unit/veritas/optimizer/logic/connective/disjunction/optimizable_to_inclusion/optimizable_spec.rb