diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-18 16:47:55 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-18 16:47:55 -0700 |
commit | 7feff4e7b52fbef356426d22257af161704315ad (patch) | |
tree | db907c2bc27dc406d08513d40f8e75cd810a91f9 /spec | |
parent | 32ad530b825f4cdac51e579306548ca695471039 (diff) | |
download | rails-7feff4e7b52fbef356426d22257af161704315ad.tar.gz rails-7feff4e7b52fbef356426d22257af161704315ad.tar.bz2 rails-7feff4e7b52fbef356426d22257af161704315ad.zip |
performance enhancements
Diffstat (limited to 'spec')
-rw-r--r-- | spec/arel/unit/predicates/binary_spec.rb | 12 | ||||
-rw-r--r-- | spec/arel/unit/relations/join_spec.rb | 17 | ||||
-rw-r--r-- | spec/arel/unit/relations/projection_spec.rb | 15 |
3 files changed, 1 insertions, 43 deletions
diff --git a/spec/arel/unit/predicates/binary_spec.rb b/spec/arel/unit/predicates/binary_spec.rb index 57b1f3a534..5dee4833d4 100644 --- a/spec/arel/unit/predicates/binary_spec.rb +++ b/spec/arel/unit/predicates/binary_spec.rb @@ -44,18 +44,6 @@ module Arel end end end - - describe '==' do - it "obtains if attribute1 and attribute2 are identical" do - Binary.new(@attribute1, @attribute2).should == Binary.new(@attribute1, @attribute2) - Binary.new(@attribute1, @attribute2).should_not == Binary.new(@attribute1, @attribute1) - end - - it "obtains if the concrete type of the predicates are identical" do - Binary.new(@attribute1, @attribute2).should == Binary.new(@attribute1, @attribute2) - Binary.new(@attribute1, @attribute2).should_not == ConcreteBinary.new(@attribute1, @attribute2) - end - end describe '#bind' do before do diff --git a/spec/arel/unit/relations/join_spec.rb b/spec/arel/unit/relations/join_spec.rb index d128dd0560..1698bf9647 100644 --- a/spec/arel/unit/relations/join_spec.rb +++ b/spec/arel/unit/relations/join_spec.rb @@ -7,23 +7,6 @@ module Arel @relation2 = Table.new(:photos) @predicate = @relation1[:id].eq(@relation2[:user_id]) end - - describe '==' do - before do - @another_predicate = @relation1[:id].eq(1) - @another_relation = Table.new(:cameras) - end - - it 'obtains if the two relations and the predicate are identical' do - Join.new("INNER JOIN", @relation1, @relation2, @predicate).should == Join.new("INNER JOIN", @relation1, @relation2, @predicate) - Join.new("INNER JOIN", @relation1, @relation2, @predicate).should_not == Join.new("INNER JOIN", @relation1, @another_relation, @predicate) - Join.new("INNER JOIN", @relation1, @relation2, @predicate).should_not == Join.new("INNER JOIN", @relation1, @relation2, @another_predicate) - end - - it 'is commutative on the relations' do - Join.new("INNER JOIN", @relation1, @relation2, @predicate).should == Join.new("INNER JOIN", @relation2, @relation1, @predicate) - end - end describe 'hashing' do it 'implements hash equality' do diff --git a/spec/arel/unit/relations/projection_spec.rb b/spec/arel/unit/relations/projection_spec.rb index cede58354b..3c6a092db5 100644 --- a/spec/arel/unit/relations/projection_spec.rb +++ b/spec/arel/unit/relations/projection_spec.rb @@ -13,20 +13,7 @@ module Arel end it "manufactures attributes associated with the projection relation" do - # @projection.attributes.should == [@attribute].collect { |a| a.bind(@projection) } - end - end - - describe '==' do - before do - @another_relation = Table.new(:photos) - @another_attribute = @relation[:name] - end - - it "obtains if the relations and attributes are identical" do - Projection.new(@relation, @attribute).should == Projection.new(@relation, @attribute) - Projection.new(@relation, @attribute).should_not == Projection.new(@another_relation, @attribute) - Projection.new(@relation, @attribute).should_not == Projection.new(@relation, @another_attribute) + @projection.attributes.should == [@attribute].collect { |a| a.bind(@projection) } end end |