Sha256: f7f32408db3b5f219aefbebb9eb134b24969bfb46f0095d3035aabb6728db7bc

Contents?: true

Size: 765 Bytes

Versions: 2

Compression:

Stored size: 765 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]], LazyEnumerable.new([[1]])).sort_by { |r| r.id } }
  let(:relation) { base.drop(offset)                                                              }
  let(:object)   { described_class.new(relation)                                                  }

  before do
    expect(object.operation).to 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

2 entries across 2 versions & 1 rubygems

Version Path
axiom-optimizer-0.2.0 spec/unit/axiom/optimizer/relation/operation/offset/zero_offset/optimizable_predicate_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/relation/operation/offset/zero_offset/optimizable_predicate_spec.rb