aboutsummaryrefslogtreecommitdiffstats
path: root/spec/algebra
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-08-06 09:14:10 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-08-06 09:14:10 -0700
commit0e9a9c7aa7791de708657c269dd7b9bb0f42b01c (patch)
treed5b1f9ec8d20f49b2095fd2af4f7ba5061c26c55 /spec/algebra
parent4c43dac54e649f579a96505e0038cfb6ea52ef1e (diff)
downloadrails-0e9a9c7aa7791de708657c269dd7b9bb0f42b01c.tar.gz
rails-0e9a9c7aa7791de708657c269dd7b9bb0f42b01c.tar.bz2
rails-0e9a9c7aa7791de708657c269dd7b9bb0f42b01c.zip
removing test code from implementation
Diffstat (limited to 'spec/algebra')
-rw-r--r--spec/algebra/unit/relations/relation_spec.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/spec/algebra/unit/relations/relation_spec.rb b/spec/algebra/unit/relations/relation_spec.rb
index d08c38acd5..a7e14e6be5 100644
--- a/spec/algebra/unit/relations/relation_spec.rb
+++ b/spec/algebra/unit/relations/relation_spec.rb
@@ -182,7 +182,10 @@ module Arel
describe '#delete' do
it 'manufactures a deletion relation' do
Session.start do |s|
- s.should_receive(:delete).with(Deletion.new(@relation))
+ s.should_receive(:delete) do |delete|
+ delete.relation.should == @relation
+ delete.should be_kind_of Deletion
+ end
@relation.delete
end
end
@@ -191,8 +194,13 @@ module Arel
describe '#insert' do
it 'manufactures an insertion relation' do
Session.start do |s|
- record = { @relation[:name] => 'carl' }
- s.should_receive(:create).with(Insert.new(@relation, record))
+ record = { @relation[:name] => Value.new('carl', @relation) }
+ s.should_receive(:create) do |insert|
+ insert.relation.should == @relation
+ insert.record.should == record
+ insert.should be_kind_of Insert
+ insert
+ end
@relation.insert(record)
end
end
@@ -202,7 +210,12 @@ module Arel
it 'manufactures an update relation' do
Session.start do |s|
assignments = { @relation[:name] => Value.new('bob', @relation) }
- s.should_receive(:update).with(Update.new(@relation, assignments))
+ s.should_receive(:update) do |update|
+ update.relation.should == @relation
+ update.assignments.should == assignments
+ update.should be_kind_of Update
+ update
+ end
@relation.update(assignments)
end
end