From 53db9d80021f399fae312eff935e437a413f8e2d Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 6 Aug 2010 09:22:36 -0700 Subject: [PATCH] removing test code from implementation --- lib/arel/algebra/relations/operations/having.rb | 6 ------ lib/arel/algebra/relations/operations/skip.rb | 7 ------- spec/algebra/unit/relations/relation_spec.rb | 5 ++++- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/lib/arel/algebra/relations/operations/having.rb b/lib/arel/algebra/relations/operations/having.rb index d36aad071b..3d8115c2f6 100644 --- a/lib/arel/algebra/relations/operations/having.rb +++ b/lib/arel/algebra/relations/operations/having.rb @@ -10,11 +10,5 @@ def initialize(relation, predicates) def havings @havings ||= relation.havings + predicates end - - def == other - super || Having === other && - relation == other.relation && - predicates == other.predicates - end end end diff --git a/lib/arel/algebra/relations/operations/skip.rb b/lib/arel/algebra/relations/operations/skip.rb index 7e4ad2b278..a9157e914c 100644 --- a/lib/arel/algebra/relations/operations/skip.rb +++ b/lib/arel/algebra/relations/operations/skip.rb @@ -7,13 +7,6 @@ def initialize relation, skipped @skipped = skipped end - def == other - super || - Skip === other && - relation == other.relation && - skipped == other.skipped - end - def eval unoperated_rows[skipped..-1] end diff --git a/spec/algebra/unit/relations/relation_spec.rb b/spec/algebra/unit/relations/relation_spec.rb index a7e14e6be5..a1ffd901d7 100644 --- a/spec/algebra/unit/relations/relation_spec.rb +++ b/spec/algebra/unit/relations/relation_spec.rb @@ -151,7 +151,10 @@ module Arel describe '#skip' do it "manufactures a skip relation" do - @relation.skip(4).should == Skip.new(@relation, 4) + skip = @relation.skip(4) + skip.relation.should == @relation + skip.skipped.should == 4 + skip.should be_kind_of Skip end describe 'when given a blank number of items' do -- GitLab