Sha256: f0ebcac0597d912aa4431839c4d1dd665b2f056c228149a56a60f7d3da3f3b48

Contents?: true

Size: 656 Bytes

Versions: 2

Compression:

Stored size: 656 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:header)   { Relation::Header.coerce([[:id, Integer]])       }
  let(:base)     { Relation.new(header, LazyEnumerable.new([[1]])) }
  let(:relation) { base.rename({}).restrict { |r| r.id.eq(1) }     }
  let(:object)   { described_class.new(relation)                   }

  before do
    expect(object).to be_optimizable
  end

  it { should be_kind_of(Algebra::Restriction) }

  it { should_not be(relation) }

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-optimizer-0.2.0 spec/unit/axiom/optimizer/algebra/restriction/unoptimized_operand/optimize_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/algebra/restriction/unoptimized_operand/optimize_spec.rb