Sha256: 014df69708999f260c5bf7d3b6f613ddc67fb5894c862049d624c83862b485fe

Contents?: true

Size: 789 Bytes

Versions: 1

Compression:

Stored size: 789 Bytes

Contents

require 'spec_helper'

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

  let(:klass)    { Optimizer::Algebra::Restriction::TruePredicate     }
  let(:base)     { Relation.new([ [ :id, Integer ] ], [ [ 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 true' do
    let(:predicate) { Logic::Proposition::True.instance }

    it { should be(true) }
  end

  context 'when the predicate is not true' do
    let(:predicate) { Logic::Proposition::False.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/true_predicate/optimizable_spec.rb