Sha256: 020e233491e7d8a0b849bc7312629e059431da04d49d8b9e7ae9b7dfe6fc5712

Contents?: true

Size: 723 Bytes

Versions: 2

Compression:

Stored size: 723 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Algebra::Projection::UnoptimizedOperand, '#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.restrict { Function::Proposition::Tautology.instance }.project([: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 be(base) }

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-optimizer-0.2.0 spec/unit/axiom/optimizer/algebra/projection/unoptimized_operand/optimize_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/algebra/projection/unoptimized_operand/optimize_spec.rb