Sha256: ecf06e68cff90c760340037ec2f1293a41b58bf5625bca071942fc3c9c1f526e

Contents?: true

Size: 740 Bytes

Versions: 3

Compression:

Stored size: 740 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Relation::Operation::Offset::ZeroOffset, '#optimizable?' do
  subject { object.optimizable? }

  let(:base)     { Relation.new([ [ :id, Integer ] ], [ [ 1 ] ].each).sort_by { |r| r.id } }
  let(:relation) { base.drop(offset)                                                       }
  let(:object)   { described_class.new(relation)                                           }

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

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

    it { should be(true) }
  end

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

    it { should be(false) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
veritas-optimizer-0.0.7 spec/unit/veritas/optimizer/relation/operation/offset/zero_offset/optimizable_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/relation/operation/offset/zero_offset/optimizable_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/relation/operation/offset/zero_offset/optimizable_spec.rb