Sha256: ce278b81137ed4bc676a3c030a301d4fe2f6006e04b5db92febeb5b58e0ef5a7

Contents?: true

Size: 700 Bytes

Versions: 2

Compression:

Stored size: 700 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

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

  before do
    expect(predicate).to be_kind_of(Function::Predicate::Inequality)
  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

2 entries across 2 versions & 1 rubygems

Version Path
axiom-optimizer-0.2.0 spec/unit/axiom/optimizer/function/predicate/inequality/contradiction/optimizable_predicate_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/function/predicate/inequality/contradiction/optimizable_predicate_spec.rb