Sha256: b05d556e334f98d522ad1ce862f0cbf5db87ae44f5033a1d1b1a6566f0ed56cc

Contents?: true

Size: 802 Bytes

Versions: 1

Compression:

Stored size: 802 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:described_class) { Class.new(Optimizer::Relation::Operation::Unary)   }
  let(:base)            { Relation.new([[:id, Integer]], LazyEnumerable.new) }
  let(:operand)         { base.sort_by { |r| r.id }                          }
  let(:relation)        { operand.project([])                                }
  let(:object)          { described_class.new(relation)                      }

  before do
    described_class.class_eval do
      include Optimizer::Relation::Operation::Unary::OrderOperand

      def wrap_operand
        'Optimized'
      end
    end

    expect(object).to be_optimizable
  end

  it { should eql('Optimized') }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/relation/operation/unary/order_operand/optimize_spec.rb