spec/unit/veritas/optimizer/relation/operation/limit/unoptimized_operand/optimizable_spec.rb in veritas-optimizer-0.0.4 vs spec/unit/veritas/optimizer/relation/operation/limit/unoptimized_operand/optimizable_spec.rb in veritas-optimizer-0.0.5
- old
+ new
@@ -3,13 +3,13 @@
require 'spec_helper'
describe Optimizer::Relation::Operation::Limit::UnoptimizedOperand, '#optimizable?' do
subject { object.optimizable? }
- let(:header) { Relation::Header.new([ [ :id, Integer ] ]) }
- let(:base) { Relation.new(header, [ [ 1 ] ].each).order }
- let(:relation) { operand.take(1) }
- let(:object) { described_class.new(relation) }
+ let(:header) { Relation::Header.new([ [ :id, Integer ] ]) }
+ let(:base) { Relation.new(header, [ [ 1 ] ].each).sort_by { |r| r.id } }
+ let(:relation) { operand.take(1) }
+ let(:object) { described_class.new(relation) }
before do
object.operation.should be_kind_of(Relation::Operation::Limit)
end