Sha256: 62c9c713b740b48cd855e82fe5b19506f22d570bc4e867a63ea2b0b1e3f24e4a

Contents?: true

Size: 747 Bytes

Versions: 4

Compression:

Stored size: 747 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:header)   { Relation::Header.new([ [ :id, Integer ], [ :name, String ], [ :age, Integer ] ]) }
  let(:base)     { Relation.new(header, [ [ 1, 'Dan Kubb', 35 ] ].each)                             }
  let(:relation) { base.project([ :id, :name ]).project([ :id ])                                    }
  let(:object)   { described_class.new(relation)                                                    }

  before do
    object.should be_optimizable
  end

  it { should be_kind_of(Algebra::Projection) }

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

  its(:header) { should == [ header[:id] ] }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
veritas-optimizer-0.0.7 spec/unit/veritas/optimizer/algebra/projection/projection_operand/optimize_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/algebra/projection/projection_operand/optimize_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/algebra/projection/projection_operand/optimize_spec.rb
veritas-optimizer-0.0.4 spec/unit/veritas/optimizer/algebra/projection/projection_operand/optimize_spec.rb