Sha256: 61c06f256a00d72395aa75de6ccc7ad776447ba0b08b455d218288a995ac5fd9

Contents?: true

Size: 718 Bytes

Versions: 1

Compression:

Stored size: 718 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

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

  before do
    expect(object).to be_optimizable
  end

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

  it { should_not be(relation) }

  its(:operand) { should be(order) }

  its(:directions) { should eql(relation.directions) }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/relation/operation/reverse/unoptimized_operand/optimize_spec.rb