Sha256: bd0f9021c441335183f34597d5c4ed6dd5d7a4831c9dd328cb5b69f6c5a1de7c

Contents?: true

Size: 845 Bytes

Versions: 4

Compression:

Stored size: 845 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Function::Connective::Conjunction::LeftOperandTautology, '#optimizable?' do
  subject { object.optimizable? }

  let(:attribute)  { Attribute::Integer.new(:id)                        }
  let(:connective) { Function::Connective::Conjunction.new(left, right) }
  let(:object)     { described_class.new(connective)                    }

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

  context 'when right is a tautology' do
    let(:left)  { Function::Proposition::Tautology.instance }
    let(:right) { attribute.eq(1)                           }

    it { should be(true) }
  end

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

    it { should be(false) }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
veritas-optimizer-0.0.7 spec/unit/veritas/optimizer/function/connective/conjunction/left_operand_tautology/optimizable_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/function/connective/conjunction/left_operand_tautology/optimizable_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/function/connective/conjunction/left_operand_tautology/optimizable_spec.rb
veritas-optimizer-0.0.4 spec/unit/veritas/optimizer/function/connective/conjunction/left_operand_tautology/optimizable_spec.rb