Sha256: 58b45cb3f62ed3cee69509ce0c2f5392a0328e91ee555c11326f34ad2272a71b

Contents?: true

Size: 723 Bytes

Versions: 2

Compression:

Stored size: 723 Bytes

Contents

require 'spec_helper'

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

  let(:klass)    { Optimizer::Relation::Operation::Unary::MaterializedOperand }
  let(:relation) { mock('Relation', :operand => operand)                      }
  let(:object)   { klass.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

2 entries across 2 versions & 1 rubygems

Version Path
veritas-0.0.2 spec/unit/veritas/optimizer/relation/operation/unary/materialized_operand/optimizable_spec.rb
veritas-0.0.1 spec/unit/veritas/optimizer/relation/operation/unary/materialized_operand/optimizable_spec.rb