From 89eff9708d9519f8a2724427d9ed9a3bcbc6d125 Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Fri, 11 Apr 2008 14:40:33 -0700 Subject: removed binding for attributes and predicates --- spec/active_relation/unit/predicates/binary_spec.rb | 15 +-------------- spec/active_relation/unit/predicates/equality_spec.rb | 2 +- spec/active_relation/unit/primitives/attribute_spec.rb | 16 ++++++++-------- spec/spec_helper.rb | 2 +- 4 files changed, 11 insertions(+), 24 deletions(-) (limited to 'spec') diff --git a/spec/active_relation/unit/predicates/binary_spec.rb b/spec/active_relation/unit/predicates/binary_spec.rb index 04f8d4f305..5dd5e5599a 100644 --- a/spec/active_relation/unit/predicates/binary_spec.rb +++ b/spec/active_relation/unit/predicates/binary_spec.rb @@ -24,7 +24,7 @@ module ActiveRelation describe 'when relating an attribute and a value' do before do - @value = "1-asdf".bind(@relation) + @value = "1-asdf" end describe 'when relating to an integer attribute' do @@ -43,19 +43,6 @@ module ActiveRelation end end end - - describe 'when relating two values' do - before do - @value = "1-asdf".bind(@relation) - @another_value = 2.bind(@relation) - end - - it 'formats values appropos of their type' do - ConcreteBinary.new(string = @value, integer = @another_value).to_sql.should be_like(" - '1-asdf' <=> 2 - ") - end - end end describe '==' do diff --git a/spec/active_relation/unit/predicates/equality_spec.rb b/spec/active_relation/unit/predicates/equality_spec.rb index 613236ad04..5415b35925 100644 --- a/spec/active_relation/unit/predicates/equality_spec.rb +++ b/spec/active_relation/unit/predicates/equality_spec.rb @@ -35,7 +35,7 @@ module ActiveRelation describe 'when relation to a nil value' do before do - @nil = nil.bind(@relation1) + @nil = nil end it "manufactures an is null predicate" do diff --git a/spec/active_relation/unit/primitives/attribute_spec.rb b/spec/active_relation/unit/primitives/attribute_spec.rb index 0f6e5e289d..fbbcbaef37 100644 --- a/spec/active_relation/unit/primitives/attribute_spec.rb +++ b/spec/active_relation/unit/primitives/attribute_spec.rb @@ -21,7 +21,7 @@ module ActiveRelation end it "returns self if the substituting to the same relation" do - @attribute.bind(@relation).should == @attribute + @attribute.should == @attribute end end @@ -97,43 +97,43 @@ module ActiveRelation describe '#eq' do it "manufactures an equality predicate" do - @attribute.eq('name').should == Equality.new(@attribute, 'name'.bind(@relation)) + @attribute.eq('name').should == Equality.new(@attribute, 'name') end end describe '#lt' do it "manufactures a less-than predicate" do - @attribute.lt(10).should == LessThan.new(@attribute, 10.bind(@relation)) + @attribute.lt(10).should == LessThan.new(@attribute, 10) end end describe '#lteq' do it "manufactures a less-than or equal-to predicate" do - @attribute.lteq(10).should == LessThanOrEqualTo.new(@attribute, 10.bind(@relation)) + @attribute.lteq(10).should == LessThanOrEqualTo.new(@attribute, 10) end end describe '#gt' do it "manufactures a greater-than predicate" do - @attribute.gt(10).should == GreaterThan.new(@attribute, 10.bind(@relation)) + @attribute.gt(10).should == GreaterThan.new(@attribute, 10) end end describe '#gteq' do it "manufactures a greater-than or equal-to predicate" do - @attribute.gteq(10).should == GreaterThanOrEqualTo.new(@attribute, 10.bind(@relation)) + @attribute.gteq(10).should == GreaterThanOrEqualTo.new(@attribute, 10) end end describe '#matches' do it "manufactures a match predicate" do - @attribute.matches(/.*/).should == Match.new(@attribute, /.*/.bind(@relation)) + @attribute.matches(/.*/).should == Match.new(@attribute, /.*/) end end describe '#in' do it "manufactures an in predicate" do - @attribute.in(1..30).should == In.new(@attribute, (1..30).bind(@relation)) + @attribute.in(1..30).should == In.new(@attribute, (1..30)) end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 01a703a7d4..4b61ae8ca8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -19,7 +19,7 @@ ActiveRecord::Base.establish_connection 'test' class Hash def shift - returning to_a.sort { |(key1, value1), (key2, value2)| key1.hash <=> key2.hash }.shift do |key, value| + returning to_a.sort { |(key1, value1), (key2, value2)| key1.hash <=> key2.hash }.shift do |key, _| delete(key) end end -- cgit v1.2.3