spec/unit/veritas/optimizer/algebra/restriction/order_operand/optimize_spec.rb in veritas-optimizer-0.0.3 vs spec/unit/veritas/optimizer/algebra/restriction/order_operand/optimize_spec.rb in veritas-optimizer-0.0.4

- old
+ new

@@ -1,18 +1,22 @@ +# encoding: utf-8 + require 'spec_helper' describe Optimizer::Algebra::Restriction::OrderOperand, '#optimize' do subject { object.optimize } let(:base) { Relation.new([ [ :id, Integer ] ], [ [ 1 ] ].each) } let(:predicate) { base[:id].eq(1) } - let(:relation) { base.order.restrict(predicate) } + let(:relation) { base.order.restrict { predicate } } let(:object) { described_class.new(relation) } before do object.should be_optimizable end - it { should be_kind_of(Relation::Operation::Order) } + it { should be_kind_of(Algebra::Restriction) } - its(:operand) { should eql(base.restrict(predicate)) } + its(:operand) { should equal(base) } + + its(:predicate) { should equal(predicate) } end