Sha256: c8e6a906cb42de8f0ce246025d0a69562765d45085e32b3b4acbf8cce7d84a76

Contents?: true

Size: 748 Bytes

Versions: 2

Compression:

Stored size: 748 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:predicate) { left.lt(right)                 }
  let(:object)    { described_class.new(predicate) }

  before do
    expect(predicate).to be_kind_of(Function::Predicate::LessThan)
  end

  context 'when left is always less than right' do
    let(:left)  { Attribute::Integer.new(:id, size: 1..9)   }
    let(:right) { Attribute::Integer.new(:id, size: 10..20) }

    it { should be(true) }
  end

  context 'when left is equivalent to the right' do
    let(:left)  { Attribute::Integer.new(:id) }
    let(:right) { Attribute::Integer.new(:id) }

    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/less_than/tautology/optimizable_predicate_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/function/predicate/less_than/tautology/optimizable_predicate_spec.rb