Sha256: fdf211bafe0e5404ac7eacbf0a9b9a02cdaf4d5c037dec5318e5f3ba58268ea7

Contents?: true

Size: 759 Bytes

Versions: 5

Compression:

Stored size: 759 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

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

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

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

    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

5 entries across 5 versions & 2 rubygems

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