Sha256: c5c377fac2f705339fed00899d390e4f507ed54b1af3c2bc7199ebefa9bd8611

Contents?: true

Size: 650 Bytes

Versions: 1

Compression:

Stored size: 650 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Relation::Operation::Limit::ZeroLimit, '#optimize' do
  subject { object.optimize }

  let(:header)   { Relation::Header.coerce([[:id, Integer]])                            }
  let(:sorted)   { Relation.new(header, LazyEnumerable.new([[1]])).sort_by { |r| r.id } }
  let(:relation) { sorted.take(0)                                                       }
  let(:object)   { described_class.new(relation)                                        }

  before do
    expect(object).to be_optimizable
  end

  it { should be_kind_of(Relation::Empty) }

  its(:header) { should be(header) }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-optimizer-0.2.0 spec/unit/axiom/optimizer/relation/operation/limit/zero_limit/optimize_spec.rb