Sha256: e67c7271f648174f97012ba62698042783997022df116296c2a7229618fac3f9

Contents?: true

Size: 763 Bytes

Versions: 1

Compression:

Stored size: 763 Bytes

Contents

require 'spec_helper'

describe 'Veritas::Optimizer::Algebra::Restriction::UnoptimizedOperand#optimize' do
  subject { object.optimize }

  let(:klass)    { Optimizer::Algebra::Restriction::UnoptimizedOperand }
  let(:header)   { Relation::Header.new([ [ :id, Integer ] ])          }
  let(:base)     { Relation.new(header, [ [ 1 ] ].each)                }
  let(:relation) { base.restrict { |r| r[:id].eq(1) }                  }
  let(:object)   { klass.new(relation)                                 }

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

  it { should be_kind_of(Algebra::Restriction) }

  it { should_not equal(relation) }

  its(:operand) { should equal(base) }

  its(:predicate) { should == base[:id].eq(1) }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.2 spec/unit/veritas/optimizer/algebra/restriction/unoptimized_operand/optimize_spec.rb