Sha256: 7cd9ecba1b9dc9f5cbc98468a4fbef81ca695b529c6e0128ef429b00692c94b5

Contents?: true

Size: 659 Bytes

Versions: 3

Compression:

Stored size: 659 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Relation::Operation::Offset::UnoptimizedOperand, '#optimize' do
  subject { object.optimize }

  let(:header)   { Relation::Header.new([ [ :id, Integer ] ])                }
  let(:order)    { Relation.new(header, [ [ 1 ] ].each).sort_by { |r| r.id } }
  let(:relation) { order.rename({}).drop(1)                                  }
  let(:object)   { described_class.new(relation)                             }

  before do
    object.should be_optimizable
  end

  it { should be_kind_of(Relation::Operation::Offset) }

  its(:operand) { should equal(order) }

  its(:offset) { should == 1 }
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/unoptimized_operand/optimize_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/relation/operation/offset/unoptimized_operand/optimize_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/relation/operation/offset/unoptimized_operand/optimize_spec.rb