Sha256: 93a8e2ca79f56d765209fb25b96593612be1db4a7aca80f03ed55f0e02e9b109

Contents?: true

Size: 864 Bytes

Versions: 2

Compression:

Stored size: 864 Bytes

Contents

require 'spec_helper'

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

  let(:klass)    { Optimizer::Algebra::Projection::UnchangedHeader               }
  let(:header)   { Relation::Header.new([ [ :id, Integer ], [ :name, String ] ]) }
  let(:base)     { Relation.new(header, [ [ 1, 'Dan Kubb' ] ].each)              }
  let(:relation) { base.project(new_header)                                      }
  let(:object)   { klass.new(relation)                                           }

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

  context 'when the header is not changed' do
    let(:new_header) { header }

    it { should be(true) }
  end

  context 'when the header is changed' do
    let(:new_header) { [ :id ] }

    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/unchanged_header/optimizable_spec.rb
veritas-0.0.1 spec/unit/veritas/optimizer/algebra/projection/unchanged_header/optimizable_spec.rb