Sha256: 9e13a356f2e3ab7fee8dee1e23917f31a61bdf60d6b196ef5c58a5b2a7a9daeb

Contents?: true

Size: 905 Bytes

Versions: 1

Compression:

Stored size: 905 Bytes

Contents

require 'spec_helper'

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

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

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

  context 'when right is true' do
    let(:left)  { Logic::Proposition::False.instance }
    let(:right) { attribute.eq(1)                    }

    it { should be(true) }
  end

  context 'when right is not true' do
    let(:left)  { attribute.eq(1) }
    let(:right) { attribute.eq(1) }

    it { should be(false) }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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