Sha256: 0a3995a276102fcefdf4e11cc93d7c2ee46060fd040a15eedc9355465464364d

Contents?: true

Size: 854 Bytes

Versions: 2

Compression:

Stored size: 854 Bytes

Contents

require 'spec_helper'

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

  let(:klass)      { Optimizer::Logic::Connective::Binary::EqualOperands }
  let(:attribute)  { Attribute::Integer.new(:id)                         }
  let(:connective) { left.and(right)                                     }
  let(:object)     { klass.new(connective)                               }

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

  context 'when left and right are equivalent' do
    let(:left)  { attribute.eq(1) }
    let(:right) { attribute.eq(1) }

    it { should be(true) }
  end

  context 'when left and right are not equivalent' do
    let(:left)  { attribute.eq(1) }
    let(:right) { attribute.ne(1) }

    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/binary/equal_operands/optimizable_spec.rb
veritas-0.0.1 spec/unit/veritas/optimizer/logic/connective/binary/equal_operands/optimizable_spec.rb