Sha256: a2d2ede905ad977826913aed38f39ab55ad3bc9856516d3edccc5f3fab99c0cd

Contents?: true

Size: 690 Bytes

Versions: 2

Compression:

Stored size: 690 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Algebra::Rename::ProjectionOperand, '#optimize' do
  subject { object.optimize }

  let(:header)   { Relation::Header.coerce([[:id, Integer], [:name, String]])  }
  let(:base)     { Relation.new(header, LazyEnumerable.new([[1, 'Dan Kubb']])) }
  let(:relation) { base.project([:id]).rename(id: :other_id)                   }
  let(:object)   { described_class.new(relation)                               }

  before do
    expect(object).to be_optimizable
  end

  it { should be_kind_of(Algebra::Projection) }

  its(:operand) { should eql(base.rename(id: :other_id)) }

  its(:header) { should == [[:other_id, Integer]] }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-optimizer-0.2.0 spec/unit/axiom/optimizer/algebra/rename/projection_operand/optimize_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/algebra/rename/projection_operand/optimize_spec.rb