public
Description: Ruby interface to CouchDB
Homepage: http://code.google.com/p/activecouch/
Clone URL: git://github.com/JackDanger/active_couch.git
Search Repo:
- Remove unnecessary complexity for callback specs

git-svn-id: http://activecouch.googlecode.com/svn/trunk@68 
e44de9e2-1e40-0410-bb6c-c9d70e891a3e
arun.thampi (author)
Tue Jan 22 18:08:43 -0800 2008
commit  1c0008b01cd30484bb2fc3a90265c01aa7d94ff7
tree    7429801eb039558e737c2a713ec62c030539f329
parent  77c5b7ea6cf4f2e0ca5cb066b3bd11034ca88742
...
65
66
67
 
68
69
70
...
72
73
74
75
76
77
78
79
80
81
...
86
87
88
89
 
90
91
92
...
65
66
67
68
69
70
71
...
73
74
75
 
 
 
 
76
77
78
...
83
84
85
 
86
87
88
89
0
@@ -65,6 +65,7 @@ describe "ActiveCouch::Base #after_delete method with a block as argument" do
0
     p.save
0
     # Delete should return true...
0
     p.delete.should == true
0
+ # ...and then delete_status must be "Deleted McLovin"
0
     p.delete_status.should == "Deleted McLovin"
0
   end
0
 end
0
@@ -72,10 +73,6 @@ end
0
 describe "ActiveCouch::Base #after_save method with an Object (which implements after_save) as argument" do
0
   before(:each) do
0
     class DeleteStatusSetter
0
- def initialize(attribute)
0
- @attribute = attribute
0
- end
0
-
0
       def after_delete(record)
0
         record.delete_status = 'Deleted McLovin'
0
       end
0
@@ -86,7 +83,7 @@ describe "ActiveCouch::Base #after_save method with an Object (which implements
0
       has :name
0
       has :delete_status
0
       # Callback, after the actual save happens
0
- after_delete DeleteStatusSetter.new("delete_status")
0
+ after_delete DeleteStatusSetter.new
0
     end
0
     # Migration needed for this spec
0
     ActiveCouch::Migrator.create_database('http://localhost:5984/', 'people')
...
68
69
70
71
72
73
74
75
76
77
...
82
83
84
85
 
86
87
88
...
68
69
70
 
 
 
 
71
72
73
...
78
79
80
 
81
82
83
84
0
@@ -68,10 +68,6 @@ end
0
 describe "ActiveCouch::Base #after_save method with an Object (which implements after_save) as argument" do
0
   before(:each) do
0
     class RevisionSetter
0
- def initialize(attribute)
0
- @attribute = attribute
0
- end
0
-
0
       def after_save(record)
0
         record.saved_revision = record.rev
0
       end
0
@@ -82,7 +78,7 @@ describe "ActiveCouch::Base #after_save method with an Object (which implements
0
       has :name
0
       has :saved_revision
0
       # Callback, after the actual save happens
0
- after_save RevisionSetter.new("saved_revision")
0
+ after_save RevisionSetter.new
0
     end
0
     # Migration needed for this spec
0
     ActiveCouch::Migrator.create_database('http://localhost:5984/', 'people')
...
72
73
74
75
76
77
78
79
80
81
...
86
87
88
89
 
90
91
92
...
72
73
74
 
 
 
 
75
76
77
...
82
83
84
 
85
86
87
88
0
@@ -72,10 +72,6 @@ end
0
 describe "ActiveCouch::Base #before_save method with an Object (which implements before_save) as argument" do
0
   before(:each) do
0
     class AgeSetter
0
- def initialize(attribute)
0
- @attribute = attribute
0
- end
0
-
0
       def before_delete(record)
0
         record.age = 0
0
       end
0
@@ -86,7 +82,7 @@ describe "ActiveCouch::Base #before_save method with an Object (which implements
0
       has :name
0
       has :age, :which_is => :number
0
       # Callback, before the actual save happens
0
- before_delete AgeSetter.new("age")
0
+ before_delete AgeSetter.new
0
     end
0
     # Migration needed for this spec
0
     ActiveCouch::Migrator.create_database('http://localhost:5984/', 'people')
...
66
67
68
69
70
71
72
73
74
75
...
79
80
81
82
 
83
84
85
...
66
67
68
 
 
 
 
69
70
71
...
75
76
77
 
78
79
80
81
0
@@ -66,10 +66,6 @@ end
0
 describe "ActiveCouch::Base #before_save method with an Object (which implements before_save) as argument" do
0
   before(:each) do
0
     class NameSetter
0
- def initialize(attribute)
0
- @attribute = attribute
0
- end
0
-
0
       def before_save(record)
0
         record.first_name = 'Seth'
0
       end
0
@@ -79,7 +75,7 @@ describe "ActiveCouch::Base #before_save method with an Object (which implements
0
       site 'http://localhost:5984/'
0
       has :first_name; has :last_name
0
       # Callback, before the actual save happens
0
- before_save NameSetter.new("first_name")
0
+ before_save NameSetter.new
0
     end
0
     
0
     # Migration needed for this spec

Comments

    No one has commented yet.