Sha256: bdcced3e10c1aa80d8dd7d831fc6eb6936a495430c21de9c3ec8821c058bdc0e

Contents?: true

Size: 688 Bytes

Versions: 5

Compression:

Stored size: 688 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Function::Predicate::Equality::Tautology, '#optimizable?' do
  subject { object.optimizable? }

  let(:attribute) { Attribute::Integer.new(:id)    }
  let(:predicate) { left.eq(right)                 }
  let(:object)    { described_class.new(predicate) }

  before do
    predicate.should be_kind_of(Function::Predicate::Equality)
  end

  context 'when left and right are equal' do
    let(:left)  { attribute }
    let(:right) { attribute }

    it { should be(true) }
  end

  context 'when left and right are not equal' do
    let(:left)  { attribute }
    let(:right) { 1         }

    it { should be(false) }
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
axiom-optimizer-0.1.0 spec/unit/axiom/optimizer/function/predicate/equality/tautology/optimizable_predicate_spec.rb
veritas-optimizer-0.0.7 spec/unit/veritas/optimizer/function/predicate/equality/tautology/optimizable_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/function/predicate/equality/tautology/optimizable_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/function/predicate/equality/tautology/optimizable_spec.rb
veritas-optimizer-0.0.4 spec/unit/veritas/optimizer/function/predicate/equality/tautology/optimizable_spec.rb