Sha256: 7df8e7cb6c483ba20346b42b978d47f307202a9b5311b7d4b3f4df517fba9029

Contents?: true

Size: 849 Bytes

Versions: 1

Compression:

Stored size: 849 Bytes

Contents

require 'spec_helper'

describe 'Veritas::Optimizer::Algebra::Restriction::FalsePredicate#optimizable?' do
  subject { object.optimizable? }

  let(:klass)    { Optimizer::Algebra::Restriction::FalsePredicate }
  let(:header)   { Relation::Header.new([ [ :id, Integer ] ])      }
  let(:base)     { Relation.new(header, [ [ 1 ] ].each)            }
  let(:relation) { base.restrict(predicate)                        }
  let(:object)   { klass.new(relation)                             }

  before do
    object.operation.should be_kind_of(Algebra::Restriction)
  end

  context 'when the predicate is false' do
    let(:predicate) { Logic::Proposition::False.instance }

    it { should be(true) }
  end

  context 'when the predicate is not false' do
    let(:predicate) { Logic::Proposition::True.instance }

    it { should be(false) }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.2 spec/unit/veritas/optimizer/algebra/restriction/false_predicate/optimizable_spec.rb