Sha256: 291e515ab8299e502784b55dda5694ce1024d05dfa6c0b6b7ba3d058f80905d0

Contents?: true

Size: 716 Bytes

Versions: 2

Compression:

Stored size: 716 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Relation::Operation::Unary::MaterializedOperand, '#optimizable?' do
  subject { object.optimizable? }

  let(:header)   { double('Header')                                     }
  let(:relation) { double('Relation', operand: operand, header: header) }
  let(:object)   { described_class.new(relation)                        }

  context 'when the operand is materialized' do
    let(:operand) { Relation::Materialized.new([[:id, Integer]], [[1]]) }

    it { should be(true) }
  end

  context 'when the operand is not materialized' do
    let(:operand) { Relation.new([[:id, Integer]], LazyEnumerable.new([[1]])) }

    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/relation/operation/unary/materialized_operand/optimizable_predicate_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/relation/operation/unary/materialized_operand/optimizable_predicate_spec.rb