Sha256: e99654ec0b64dbb8ac55285e656b29e55604a1f0f25915cf083bb9335e7055c6

Contents?: true

Size: 898 Bytes

Versions: 1

Compression:

Stored size: 898 Bytes

Contents

require 'spec_helper'

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

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

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

  context 'when right is true' do
    let(:left)  { Logic::Proposition::True.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/conjunction/true_left_operand/optimizable_spec.rb