Sha256: 306b4e0071015c5973565796ea1845e19b8b43138cfcaa5556d330caab820f3e

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Algebra::Summarization::EmptySummarizePer, '#optimize' do
  subject { object.optimize }

  let(:header)        { Relation::Header.new([ [ :id, Integer ], [ :name, String ] ])           }
  let(:base)          { Relation.new(header, [ [ 1, 'Dan Kubb' ] ].each)                        }
  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
    object.should be_optimizable
  end

  it { should be_kind_of(Relation::Empty) }

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

  its(:tuples) { should equal(relation) }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
veritas-optimizer-0.0.7 spec/unit/veritas/optimizer/algebra/summarization/empty_summarize_per/optimize_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/algebra/summarization/empty_summarize_per/optimize_spec.rb