Sha256: 9d023a42eff324682cf8489a8dffe3c416c9a58b911f1d837bcd75d49cf19f9d

Contents?: true

Size: 827 Bytes

Versions: 2

Compression:

Stored size: 827 Bytes

Contents

require 'spec_helper'

describe 'Veritas::Optimizer::Algebra::Projection::EmptyOperand#optimizable?' do
  subject { object.optimizable? }

  let(:klass)    { Optimizer::Algebra::Projection::EmptyOperand                  }
  let(:header)   { Relation::Header.new([ [ :id, Integer ], [ :name, String ] ]) }
  let(:relation) { operand.project([ :id ])                                      }
  let(:object)   { klass.new(relation)                                           }

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

  context 'when the operand is empty' do
    let(:operand) { Relation::Empty.new(header) }

    it { should be(true) }
  end

  context 'when the operand is not empty' do
    let(:operand) { Relation.new(header, [ [ 1, 'Dan Kubb' ] ]) }

    it { should be(false) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
veritas-0.0.2 spec/unit/veritas/optimizer/algebra/projection/empty_operand/optimizable_spec.rb
veritas-0.0.1 spec/unit/veritas/optimizer/algebra/projection/empty_operand/optimizable_spec.rb