Sha256: 9f599854d674dd06eee894952d76ae710639aaa597939be07dbee2c2e96acc4f

Contents?: true

Size: 778 Bytes

Versions: 2

Compression:

Stored size: 778 Bytes

Contents

require 'spec_helper'

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

  let(:klass)    { Optimizer::Relation::Operation::Offset::OffsetOperand    }
  let(:base)     { Relation.new([ [ :id, Integer ] ], [ [ 1 ] ].each).order }
  let(:relation) { operand.drop(1)                                          }
  let(:object)   { klass.new(relation)                                      }

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

  context 'when the operand is an offset' do
    let(:operand) { base.drop(1) }

    it { should be(true) }
  end

  context 'when the operand is not an offset' do
    let(:operand) { base }

    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/offset/offset_operand/optimizable_spec.rb
veritas-0.0.1 spec/unit/veritas/optimizer/relation/operation/offset/offset_operand/optimizable_spec.rb