Sha256: 61faed82f9a6cb9eec78ab2e381101210e864e3742f8776ef0d15637c1a7fb1b

Contents?: true

Size: 749 Bytes

Versions: 2

Compression:

Stored size: 749 Bytes

Contents

require 'spec_helper'

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

  let(:klass)    { Optimizer::Relation::Operation::Order::OrderOperand }
  let(:base)     { Relation.new([ [ :id, Integer ] ], [ [ 1 ] ].each)  }
  let(:relation) { operand.order                                       }
  let(:object)   { klass.new(relation)                                 }

  before do
    object.operation.should be_kind_of(Relation::Operation::Order)
  end

  context 'when the operand is ordered' do
    let(:operand) { base.order }

    it { should be(true) }
  end

  context 'when the operand is not ordered' do
    let(:operand) { base }

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