Sha256: ed84c4f38be46dfbadd346df1296d4d92444750fabb7dce5f07e6cbd29542097
Contents?: true
Size: 1.07 KB
Versions: 1
Compression:
Stored size: 1.07 KB
Contents
require 'spec_helper' describe 'Veritas::Optimizer::Relation::Operation::Limit::LimitOperand#optimize' do subject { object.optimize } let(:klass) { Optimizer::Relation::Operation::Limit::LimitOperand } let(:order) { Relation.new([ [ :id, Integer ] ], [ [ 1 ] ].each).order } let(:limit) { order.take(2) } let(:object) { klass.new(relation) } before do object.operation.should be_kind_of(Relation::Operation::Limit) object.operand.should be_kind_of(Relation::Operation::Limit) end context 'when the operand has a larger limit than the operation' do let(:relation) { limit.take(1) } it { should be_kind_of(Relation::Operation::Limit) } its(:operand) { should equal(order) } its(:limit) { should == 1 } end context 'when the operand has a smaller limit than the operation' do let(:relation) { limit.take(3) } it { should be_kind_of(Relation::Operation::Limit) } its(:operand) { should equal(order) } its(:limit) { should == 2 } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
veritas-0.0.2 | spec/unit/veritas/optimizer/relation/operation/limit/limit_operand/optimize_spec.rb |