Sha256: 5ad75a0dee1da3e0f15798402374bb16e88dfea417975e6b31dbef5b08f2fca9

Contents?: true

Size: 658 Bytes

Versions: 2

Compression:

Stored size: 658 Bytes

Contents

require 'spec_helper'

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

  let(:klass)    { Optimizer::Relation::Operation::Unary::EmptyOperand }
  let(:relation) { mock('Relation', :operand => operand)               }
  let(:object)   { klass.new(relation)                                 }

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

    it { should be(true) }
  end

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

    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/empty_operand/optimizable_spec.rb
veritas-0.0.1 spec/unit/veritas/optimizer/relation/operation/unary/empty_operand/optimizable_spec.rb