Sha256: fbfce68c6acb0bb49f534e40709df82a1f6758b97f42fee6ca6c9d1329a8f228

Contents?: true

Size: 600 Bytes

Versions: 3

Compression:

Stored size: 600 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Relation::Operation::Reverse::ReverseOperand, '#optimize' do
  subject { object.optimize }

  let(:base)     { Relation.new([ [ :id, Integer ] ], [ [ 1 ] ].each) }
  let(:limit)    { base.sort_by { |r| r.id }.take(2)                  }
  let(:operand)  { limit.reverse                                      }
  let(:relation) { operand.reverse                                    }
  let(:object)   { described_class.new(relation)                      }

  before do
    object.should be_optimizable
  end

  it { should equal(limit) }
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
veritas-optimizer-0.0.7 spec/unit/veritas/optimizer/relation/operation/reverse/reverse_operand/optimize_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/relation/operation/reverse/reverse_operand/optimize_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/relation/operation/reverse/reverse_operand/optimize_spec.rb