Sha256: e10a99327e1477dc5db5b3439fb88fd4b2b53fb236124b206ed19fa83599168f

Contents?: true

Size: 1006 Bytes

Versions: 2

Compression:

Stored size: 1006 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Algebra::Summarization::EmptySummarizePer, '#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(:attribute)     { Attribute::Object.new(:test)                                            }
  let(:operand)       { base                                                                    }
  let(:summarize_per) { base.project([:id]).restrict { false }                                  }
  let(:relation)      { operand.summarize(summarize_per) { |r| r.add(attribute, r.name.count) } }
  let(:object)        { described_class.new(relation)                                           }

  before do
    expect(object).to be_optimizable
  end

  it { should be_kind_of(Relation::Empty) }

  its(:header) { should == [[:id, Integer], [:test, Object]] }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-optimizer-0.2.0 spec/unit/axiom/optimizer/algebra/summarization/empty_summarize_per/optimize_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/algebra/summarization/empty_summarize_per/optimize_spec.rb