aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-07-30 10:13:55 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-30 10:13:55 -0700
commitee6443f21709c8fb2927316bc90f9e2db8a17566 (patch)
tree5533be2020cfdd8a8e08b260378c66a9512e8436
parent0e957e05acc8bd53a42d53bf94d6cd4f2441737a (diff)
downloadrails-ee6443f21709c8fb2927316bc90f9e2db8a17566.tar.gz
rails-ee6443f21709c8fb2927316bc90f9e2db8a17566.tar.bz2
rails-ee6443f21709c8fb2927316bc90f9e2db8a17566.zip
better tests for Taken constructor, removing Take#==
-rw-r--r--lib/arel/algebra/relations/operations/take.rb7
-rw-r--r--spec/algebra/unit/relations/relation_spec.rb4
2 files changed, 3 insertions, 8 deletions
diff --git a/lib/arel/algebra/relations/operations/take.rb b/lib/arel/algebra/relations/operations/take.rb
index 7098d578d5..421051124c 100644
--- a/lib/arel/algebra/relations/operations/take.rb
+++ b/lib/arel/algebra/relations/operations/take.rb
@@ -7,13 +7,6 @@ module Arel
@taken = taken
end
- def == other
- super ||
- Take === other &&
- relation == other.relation &&
- taken == other.taken
- end
-
def engine
engine = relation.engine
diff --git a/spec/algebra/unit/relations/relation_spec.rb b/spec/algebra/unit/relations/relation_spec.rb
index ec311d0c43..1a15471f9a 100644
--- a/spec/algebra/unit/relations/relation_spec.rb
+++ b/spec/algebra/unit/relations/relation_spec.rb
@@ -134,7 +134,9 @@ module Arel
describe '#take' do
it "manufactures a take relation" do
- @relation.take(5).should == Take.new(@relation, 5)
+ take = @relation.take(5)
+ take.relation.should == @relation
+ take.taken.should == 5
end
describe 'when given a blank number of items' do