Sha256: 5b70c0359ec7518ce0b08929eed46eedf6133be1eb39dd005f26c17544c7981e

Contents?: true

Size: 903 Bytes

Versions: 5

Compression:

Stored size: 903 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Algebra::Extension, '#extensions' do
  subject { object.extensions }

  let(:base)          { Relation.new([ [ :id, Integer ] ], [ [ 1 ] ])  }
  let(:attribute)     { Attribute::Object.new(:test)                   }
  let(:summarize_per) { TABLE_DEE                                      }
  let(:relation)      { base.extend { |r| r.add(attribute, function) } }
  let(:object)        { described_class.new(relation)                  }

  before do
    object.operation.should be_kind_of(Algebra::Extension)
  end

  context 'when extensions are optimized' do
    let(:function) { 1 }

    it { should eql(relation.extensions) }
  end

  context 'when extensions are not optimized' do
    let(:function) { Function::Numeric::Absolute.new(1) }

    it { should_not equal(relation.extensions) }

    it { should eql(attribute => 1) }
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
axiom-optimizer-0.1.0 spec/unit/axiom/optimizer/algebra/extension/extensions_spec.rb
veritas-optimizer-0.0.7 spec/unit/veritas/optimizer/algebra/extension/extensions_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/algebra/extension/extensions_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/algebra/extension/extensions_spec.rb
veritas-optimizer-0.0.4 spec/unit/veritas/optimizer/algebra/extension/extensions_spec.rb