spec/unit/veritas/optimizer/relation/operation/limit/unoptimized_operand/optimize_spec.rb in veritas-optimizer-0.0.4 vs spec/unit/veritas/optimizer/relation/operation/limit/unoptimized_operand/optimize_spec.rb in veritas-optimizer-0.0.5

- old
+ new

@@ -3,13 +3,13 @@ require 'spec_helper' describe Optimizer::Relation::Operation::Limit::UnoptimizedOperand, '#optimize' do subject { object.optimize } - let(:header) { Relation::Header.new([ [ :id, Integer ] ]) } - let(:order) { Relation.new(header, [ [ 1 ] ].each).order } - let(:relation) { order.rename({}).take(1) } - let(:object) { described_class.new(relation) } + let(:header) { Relation::Header.new([ [ :id, Integer ] ]) } + let(:order) { Relation.new(header, [ [ 1 ] ].each).sort_by { |r| r.id } } + let(:relation) { order.rename({}).take(1) } + let(:object) { described_class.new(relation) } before do object.should be_optimizable end