spec/unit/axiom/optimizer/algebra/rename/limit_operand/optimize_spec.rb in axiom-optimizer-0.1.0 vs spec/unit/axiom/optimizer/algebra/rename/limit_operand/optimize_spec.rb in axiom-optimizer-0.1.1

- old
+ new

@@ -3,21 +3,21 @@ require 'spec_helper' describe Optimizer::Algebra::Rename::LimitOperand, '#optimize' do subject { object.optimize } - let(:header) { Relation::Header.coerce([ [ :id, Integer ] ]) } - let(:base) { Relation.new(header, LazyEnumerable.new([ [ 1 ] ])) } - let(:order) { base.sort_by { |r| r.id } } - let(:relation) { order.take(2).rename(:id => :other_id) } - let(:object) { described_class.new(relation) } + let(:header) { Relation::Header.coerce([[:id, Integer]]) } + let(:base) { Relation.new(header, LazyEnumerable.new([[1]])) } + let(:order) { base.sort_by { |r| r.id } } + let(:relation) { order.take(2).rename(id: :other_id) } + let(:object) { described_class.new(relation) } before do - object.should be_optimizable + expect(object).to be_optimizable end it { should be_kind_of(Relation::Operation::Limit) } - its(:operand) { should eql(order.rename(:id => :other_id)) } + its(:operand) { should eql(order.rename(id: :other_id)) } its(:limit) { should == 2 } end