Sha256: 72b968922e1eb5b801ee57e0ffa81712c5640b808479ab893a581b2628f29af1

Contents?: true

Size: 704 Bytes

Versions: 2

Compression:

Stored size: 704 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Algebra::Product::TableDeeLeft, '#optimizable?' do
  subject { object.optimizable? }

  let(:right)    { Relation.new([[:id, Integer]], LazyEnumerable.new([[1]])) }
  let(:relation) { left.product(right)                                       }
  let(:object)   { described_class.new(relation)                             }

  before do
    expect(object.operation).to be_kind_of(Algebra::Product)
  end

  context 'when the left operand is a table dee' do
    let(:left) { TABLE_DEE }

    it { should be(true) }
  end

  context 'when the left operand is not table dee' do
    let(:left) { TABLE_DUM }

    it { should be(false) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-optimizer-0.2.0 spec/unit/axiom/optimizer/algebra/product/table_dee_left/optimizable_predicate_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/algebra/product/table_dee_left/optimizable_predicate_spec.rb