Sha256: 49cb2b518abcd1e55a8494565687cc412dad81866cc56919d5a623007e0eeed4

Contents?: true

Size: 745 Bytes

Versions: 2

Compression:

Stored size: 745 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:attribute)  { Attribute::Integer.new(:id)     }
  let(:left)       { attribute.include([1])          }
  let(:right)      { attribute.exclude([2])          }
  let(:object)     { described_class.new(connective) }

  before do
    expect(object.operation).to be_kind_of(Function::Connective::Binary)
  end

  context 'when the left operand is redundant' do
    let(:connective) { left.and(right).and(right) }

    it { should be(true) }
  end

  context 'when the left operand is not redundant' do
    let(:connective) { left.and(right) }

    it { should be(false) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-optimizer-0.2.0 spec/unit/axiom/optimizer/function/connective/binary/redundant_left/optimizable_predicate_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/function/connective/binary/redundant_left/optimizable_predicate_spec.rb