diff options
author | Bryan Helmkamp <bryan@brynary.com> | 2008-01-14 10:50:46 -0500 |
---|---|---|
committer | Bryan Helmkamp <bryan@brynary.com> | 2008-01-14 10:50:46 -0500 |
commit | 553eb0ad490abc7f85d9836c3ba959ab771d3cf4 (patch) | |
tree | baa9714465488d77980e8d252a82849b32844d3b /spec/active_relation/predicates/equality_spec.rb | |
parent | 17a5fd13bc4ba8405d95e90d12b87dcd7e5bea5b (diff) | |
download | rails-553eb0ad490abc7f85d9836c3ba959ab771d3cf4.tar.gz rails-553eb0ad490abc7f85d9836c3ba959ab771d3cf4.tar.bz2 rails-553eb0ad490abc7f85d9836c3ba959ab771d3cf4.zip |
Remove ActiveRelation sub-modules and refactor specs
Diffstat (limited to 'spec/active_relation/predicates/equality_spec.rb')
-rw-r--r-- | spec/active_relation/predicates/equality_spec.rb | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/spec/active_relation/predicates/equality_spec.rb b/spec/active_relation/predicates/equality_spec.rb index 9394e63835..d23893e438 100644 --- a/spec/active_relation/predicates/equality_spec.rb +++ b/spec/active_relation/predicates/equality_spec.rb @@ -1,28 +1,30 @@ require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper') -describe ActiveRelation::Predicates::Equality do - before do - @relation1 = ActiveRelation::Relations::Table.new(:foo) - @relation2 = ActiveRelation::Relations::Table.new(:bar) - @attribute1 = ActiveRelation::Primitives::Attribute.new(@relation1, :name) - @attribute2 = ActiveRelation::Primitives::Attribute.new(@relation2, :name) - end - - describe '==' do - it "obtains if attribute1 and attribute2 are identical" do - ActiveRelation::Predicates::Equality.new(@attribute1, @attribute2).should == ActiveRelation::Predicates::Equality.new(@attribute1, @attribute2) - ActiveRelation::Predicates::Equality.new(@attribute1, @attribute2).should_not == ActiveRelation::Predicates::Equality.new(@attribute1, @attribute1) +module ActiveRelation + describe Equality do + before do + @relation1 = Table.new(:foo) + @relation2 = Table.new(:bar) + @attribute1 = Attribute.new(@relation1, :name) + @attribute2 = Attribute.new(@relation2, :name) end + + describe '==' do + it "obtains if attribute1 and attribute2 are identical" do + Equality.new(@attribute1, @attribute2).should == Equality.new(@attribute1, @attribute2) + Equality.new(@attribute1, @attribute2).should_not == Equality.new(@attribute1, @attribute1) + end - it "obtains if the concrete type of the predicates are identical" do - ActiveRelation::Predicates::Equality.new(@attribute1, @attribute2).should_not == ActiveRelation::Predicates::Binary.new(@attribute1, @attribute2) - end + it "obtains if the concrete type of the predicates are identical" do + Equality.new(@attribute1, @attribute2).should_not == Binary.new(@attribute1, @attribute2) + end - it "is commutative on the attributes" do - ActiveRelation::Predicates::Equality.new(@attribute1, @attribute2).should == ActiveRelation::Predicates::Equality.new(@attribute2, @attribute1) + it "is commutative on the attributes" do + Equality.new(@attribute1, @attribute2).should == Equality.new(@attribute2, @attribute1) + end end - end - describe '#to_sql' do + describe '#to_sql' do + end end end
\ No newline at end of file |