Sha256: 3086ba49c8090c56b9c01f866ee9f1d6a83d63edef527593892a49b035e315e6

Contents?: true

Size: 673 Bytes

Versions: 3

Compression:

Stored size: 673 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Relation::Operation::Binary::LeftOrderOperand, '#optimizable?' do
  subject { object.optimizable? }

  let(:relation) { mock('Relation', :left => left, :right => right) }
  let(:right)    { mock('Right')                                    }
  let(:object)   { described_class.new(relation)                    }

  context 'when left is an order' do
    let(:left) { Relation.new([ [ :id, Integer ] ], [].each).sort_by { |r| r.id } }

    it { should be(true) }
  end

  context 'when left is not an order' do
    let(:left) { Relation.new([ [ :id, Integer ] ], [].each) }

    it { should be(false) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
veritas-optimizer-0.0.7 spec/unit/veritas/optimizer/relation/operation/binary/left_order_operand/optimizable_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/relation/operation/binary/left_order_operand/optimizable_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/relation/operation/binary/left_order_operand/optimizable_spec.rb