Sha256: 14951349741933146319e4611a3b771df5bee63b830409277cc0a807a419bd46

Contents?: true

Size: 754 Bytes

Versions: 2

Compression:

Stored size: 754 Bytes

Contents

require 'spec_helper'

describe 'Veritas::Optimizer::Relation::Operation::Limit::ZeroLimit#optimizable?' do
  subject { object.optimizable? }

  let(:klass)    { Optimizer::Relation::Operation::Limit::ZeroLimit         }
  let(:base)     { Relation.new([ [ :id, Integer ] ], [ [ 1 ] ].each).order }
  let(:relation) { base.take(limit)                                         }
  let(:object)   { klass.new(relation)                                      }

  before do
    object.operation.should be_kind_of(Relation::Operation::Limit)
  end

  context 'when the operation limit is 0' do
    let(:limit) { 0 }

    it { should be(true) }
  end

  context 'when the operation limit is not 0' do
    let(:limit) { 1 }

    it { should be(false) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
veritas-0.0.2 spec/unit/veritas/optimizer/relation/operation/limit/zero_limit/optimizable_spec.rb
veritas-0.0.1 spec/unit/veritas/optimizer/relation/operation/limit/zero_limit/optimizable_spec.rb