Sha256: b045049ef774b24e7d8cc971aacd2dd7cef9d081eeb73d8e6fb62e4c53b867a8

Contents?: true

Size: 729 Bytes

Versions: 4

Compression:

Stored size: 729 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:header)   { mock('Header')                                           }
  let(:relation) { mock('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 ] ], [ [ 1 ] ].each) }

    it { should be(false) }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
veritas-optimizer-0.0.7 spec/unit/veritas/optimizer/relation/operation/unary/materialized_operand/optimizable_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/relation/operation/unary/materialized_operand/optimizable_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/relation/operation/unary/materialized_operand/optimizable_spec.rb
veritas-optimizer-0.0.4 spec/unit/veritas/optimizer/relation/operation/unary/materialized_operand/optimizable_spec.rb