Sha256: 67abfd7c3c92e2ca6d5ec2a9c635d390ce46639bd54ce533a20f40112482695b

Contents?: true

Size: 642 Bytes

Versions: 1

Compression:

Stored size: 642 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

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

  before do
    expect(object).to be_optimizable
  end

  it { should be(limit) }
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/equal_limit_operand/optimize_spec.rb