diff options
Diffstat (limited to 'spec/arel/algebra/unit/relations')
-rw-r--r-- | spec/arel/algebra/unit/relations/alias_spec.rb | 4 | ||||
-rw-r--r-- | spec/arel/algebra/unit/relations/delete_spec.rb | 2 | ||||
-rw-r--r-- | spec/arel/algebra/unit/relations/group_spec.rb | 2 | ||||
-rw-r--r-- | spec/arel/algebra/unit/relations/insert_spec.rb | 2 | ||||
-rw-r--r-- | spec/arel/algebra/unit/relations/join_spec.rb | 6 | ||||
-rw-r--r-- | spec/arel/algebra/unit/relations/order_spec.rb | 2 | ||||
-rw-r--r-- | spec/arel/algebra/unit/relations/project_spec.rb | 10 | ||||
-rw-r--r-- | spec/arel/algebra/unit/relations/relation_spec.rb | 36 | ||||
-rw-r--r-- | spec/arel/algebra/unit/relations/skip_spec.rb | 2 | ||||
-rw-r--r-- | spec/arel/algebra/unit/relations/table_spec.rb | 10 | ||||
-rw-r--r-- | spec/arel/algebra/unit/relations/take_spec.rb | 2 | ||||
-rw-r--r-- | spec/arel/algebra/unit/relations/update_spec.rb | 2 | ||||
-rw-r--r-- | spec/arel/algebra/unit/relations/where_spec.rb | 6 |
13 files changed, 43 insertions, 43 deletions
diff --git a/spec/arel/algebra/unit/relations/alias_spec.rb b/spec/arel/algebra/unit/relations/alias_spec.rb index c87a0ca2dd..a5d716a638 100644 --- a/spec/arel/algebra/unit/relations/alias_spec.rb +++ b/spec/arel/algebra/unit/relations/alias_spec.rb @@ -5,7 +5,7 @@ module Arel before do @relation = Table.new(:users) end - + describe '==' do it "obtains if the objects are the same" do Alias.new(@relation).should_not == Alias.new(@relation) @@ -13,4 +13,4 @@ module Arel end end end -end
\ No newline at end of file +end diff --git a/spec/arel/algebra/unit/relations/delete_spec.rb b/spec/arel/algebra/unit/relations/delete_spec.rb index 075e59e724..7578e12a3e 100644 --- a/spec/arel/algebra/unit/relations/delete_spec.rb +++ b/spec/arel/algebra/unit/relations/delete_spec.rb @@ -6,4 +6,4 @@ module Arel @relation = Table.new(:users) end end -end
\ No newline at end of file +end diff --git a/spec/arel/algebra/unit/relations/group_spec.rb b/spec/arel/algebra/unit/relations/group_spec.rb index 050de2993d..58f9252356 100644 --- a/spec/arel/algebra/unit/relations/group_spec.rb +++ b/spec/arel/algebra/unit/relations/group_spec.rb @@ -7,4 +7,4 @@ module Arel @attribute = @relation[:id] end end -end
\ No newline at end of file +end diff --git a/spec/arel/algebra/unit/relations/insert_spec.rb b/spec/arel/algebra/unit/relations/insert_spec.rb index 184cd2a926..feb1a5eae4 100644 --- a/spec/arel/algebra/unit/relations/insert_spec.rb +++ b/spec/arel/algebra/unit/relations/insert_spec.rb @@ -6,4 +6,4 @@ module Arel @relation = Table.new(:users) end end -end
\ No newline at end of file +end diff --git a/spec/arel/algebra/unit/relations/join_spec.rb b/spec/arel/algebra/unit/relations/join_spec.rb index 5b512cc7f6..f5a8bd32aa 100644 --- a/spec/arel/algebra/unit/relations/join_spec.rb +++ b/spec/arel/algebra/unit/relations/join_spec.rb @@ -7,14 +7,14 @@ module Arel @relation2 = Table.new(:photos) @predicate = @relation1[:id].eq(@relation2[:user_id]) end - + describe 'hashing' do it 'implements hash equality' do InnerJoin.new(@relation1, @relation2, @predicate) \ .should hash_the_same_as(InnerJoin.new(@relation1, @relation2, @predicate)) end end - + describe '#attributes' do it 'combines the attributes of the two relations' do join = InnerJoin.new(@relation1, @relation2, @predicate) @@ -23,4 +23,4 @@ module Arel end end end -end
\ No newline at end of file +end diff --git a/spec/arel/algebra/unit/relations/order_spec.rb b/spec/arel/algebra/unit/relations/order_spec.rb index 0e1b1a0e54..4f163894c8 100644 --- a/spec/arel/algebra/unit/relations/order_spec.rb +++ b/spec/arel/algebra/unit/relations/order_spec.rb @@ -8,4 +8,4 @@ module Arel end end end -
\ No newline at end of file + diff --git a/spec/arel/algebra/unit/relations/project_spec.rb b/spec/arel/algebra/unit/relations/project_spec.rb index b71acf5e91..9f4358ea54 100644 --- a/spec/arel/algebra/unit/relations/project_spec.rb +++ b/spec/arel/algebra/unit/relations/project_spec.rb @@ -6,24 +6,24 @@ module Arel @relation = Table.new(:users) @attribute = @relation[:id] end - + describe '#attributes' do before do @projection = Project.new(@relation, @attribute) end - + it "manufactures attributes associated with the projection relation" do @projection.attributes.should == [@attribute].collect { |a| a.bind(@projection) } end end - + describe '#externalizable?' do describe 'when the projections are attributes' do it 'returns false' do Project.new(@relation, @attribute).should_not be_externalizable end end - + describe 'when the projections include an aggregation' do it "obtains" do Project.new(@relation, @attribute.sum).should be_externalizable @@ -31,4 +31,4 @@ module Arel end end end -end
\ No newline at end of file +end diff --git a/spec/arel/algebra/unit/relations/relation_spec.rb b/spec/arel/algebra/unit/relations/relation_spec.rb index 9707f2887c..adf82847ac 100644 --- a/spec/arel/algebra/unit/relations/relation_spec.rb +++ b/spec/arel/algebra/unit/relations/relation_spec.rb @@ -7,14 +7,14 @@ module Arel @attribute1 = @relation[:id] @attribute2 = @relation[:name] end - + describe '[]' do describe 'when given an', Attribute do it "return the attribute congruent to the provided attribute" do @relation[@attribute1].should == @attribute1 end end - + describe 'when given a', Symbol, String do it "returns the attribute with the same name, if it exists" do @relation[:id].should == @attribute1 @@ -23,13 +23,13 @@ module Arel end end end - + describe Relation::Operable do describe 'joins' do before do @predicate = @relation[:id].eq(@relation[:id]) end - + describe '#join' do describe 'when given a relation' do it "manufactures an inner join operation between those two relations" do @@ -37,13 +37,13 @@ module Arel should == InnerJoin.new(@relation, @relation, @predicate) end end - + describe "when given a string" do it "manufactures a join operation with the string passed through" do - @relation.join(arbitrary_string = "ASDF").should == StringJoin.new(@relation, arbitrary_string) + @relation.join(arbitrary_string = "ASDF").should == StringJoin.new(@relation, arbitrary_string) end end - + describe "when given something blank" do it "returns self" do @relation.join.should == @relation @@ -64,7 +64,7 @@ module Arel @relation.project(@attribute1, @attribute2). \ should == Project.new(@relation, @attribute1, @attribute2) end - + describe "when given blank attributes" do it "returns self" do @relation.project.should == @relation @@ -97,36 +97,36 @@ module Arel end end end - + describe '#order' do it "manufactures an order relation" do @relation.order(@attribute1, @attribute2).should == Order.new(@relation, @attribute1, @attribute2) end - + describe 'when given a blank ordering' do it 'returns self' do @relation.order.should == @relation end end end - + describe '#take' do it "manufactures a take relation" do @relation.take(5).should == Take.new(@relation, 5) end - + describe 'when given a blank number of items' do it 'returns self' do @relation.take.should == @relation end end end - + describe '#skip' do it "manufactures a skip relation" do @relation.skip(4).should == Skip.new(@relation, 4) end - + describe 'when given a blank number of items' do it 'returns self' do @relation.skip.should == @relation @@ -138,14 +138,14 @@ module Arel it 'manufactures a group relation' do @relation.group(@attribute1, @attribute2).should == Group.new(@relation, @attribute1, @attribute2) end - + describe 'when given blank groupings' do it 'returns self' do @relation.group.should == @relation end end end - + describe Relation::Operable::Writable do describe '#delete' do it 'manufactures a deletion relation' do @@ -177,7 +177,7 @@ module Arel end end end - + describe Relation::Enumerable do it "implements enumerable" do @relation.collect.should == @relation.session.read(@relation).collect @@ -185,4 +185,4 @@ module Arel end end end -end
\ No newline at end of file +end diff --git a/spec/arel/algebra/unit/relations/skip_spec.rb b/spec/arel/algebra/unit/relations/skip_spec.rb index ff57e03d1c..a41913436e 100644 --- a/spec/arel/algebra/unit/relations/skip_spec.rb +++ b/spec/arel/algebra/unit/relations/skip_spec.rb @@ -7,4 +7,4 @@ module Arel @skipped = 4 end end -end
\ No newline at end of file +end diff --git a/spec/arel/algebra/unit/relations/table_spec.rb b/spec/arel/algebra/unit/relations/table_spec.rb index 4821d92299..dfe457043c 100644 --- a/spec/arel/algebra/unit/relations/table_spec.rb +++ b/spec/arel/algebra/unit/relations/table_spec.rb @@ -5,7 +5,7 @@ module Arel before do @relation = Table.new(:users) end - + describe '[]' do describe 'when given a', Symbol do it "manufactures an attribute if the symbol names an attribute within the relation" do @@ -18,22 +18,22 @@ module Arel it "returns the attribute if the attribute is within the relation" do @relation[@relation[:id]].should == @relation[:id] end - + it "returns nil if the attribtue is not within the relation" do another_relation = Table.new(:photos) @relation[another_relation[:id]].should be_nil end end - + describe 'when given an', Expression do before do @expression = @relation[:id].count end - + it "returns the Expression if the Expression is within the relation" do @relation[@expression].should be_nil end end end end -end
\ No newline at end of file +end diff --git a/spec/arel/algebra/unit/relations/take_spec.rb b/spec/arel/algebra/unit/relations/take_spec.rb index 6f8b4fd36e..2bc17db5a1 100644 --- a/spec/arel/algebra/unit/relations/take_spec.rb +++ b/spec/arel/algebra/unit/relations/take_spec.rb @@ -7,4 +7,4 @@ module Arel @taken = 4 end end -end
\ No newline at end of file +end diff --git a/spec/arel/algebra/unit/relations/update_spec.rb b/spec/arel/algebra/unit/relations/update_spec.rb index c27afb48b2..e9642ffc99 100644 --- a/spec/arel/algebra/unit/relations/update_spec.rb +++ b/spec/arel/algebra/unit/relations/update_spec.rb @@ -6,4 +6,4 @@ module Arel @relation = Table.new(:users) end end -end
\ No newline at end of file +end diff --git a/spec/arel/algebra/unit/relations/where_spec.rb b/spec/arel/algebra/unit/relations/where_spec.rb index 3f37b53138..6c3074a3a5 100644 --- a/spec/arel/algebra/unit/relations/where_spec.rb +++ b/spec/arel/algebra/unit/relations/where_spec.rb @@ -6,13 +6,13 @@ module Arel @relation = Table.new(:users) @predicate = @relation[:id].eq(1) end - + describe '#initialize' do it "manufactures nested where relations if multiple predicates are provided" do - another_predicate = @relation[:name].lt(2) + another_predicate = @relation[:name].lt(2) Where.new(@relation, @predicate, another_predicate). \ should == Where.new(Where.new(@relation, another_predicate), @predicate) end end end -end
\ No newline at end of file +end |