Sha256: aface3833f6f3abe2ec5b6bd48c7280c201f12c912aaf38cd783f3081911886d

Contents?: true

Size: 651 Bytes

Versions: 3

Compression:

Stored size: 651 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Relation::Operation::Order::OrderOperand, '#optimize' do
  subject { object.optimize }

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

  before do
    object.should be_optimizable
  end

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

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

  its(:directions) { should eql(order.directions.reverse) }
end

Version data entries

3 entries across 3 versions & 1 rubygems

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