@@ -3,18 +3,6 @@ should = require 'should'
33StoredObject = require ' ../../data/storedObject'
44Model = require ' ../../models/model'
55
6- callCount = 0
7- args = []
8-
9- getTopic = () ->
10- topic = new Model ()
11- topic ._adapter =
12- save : (collection , attributes , callback ) ->
13- callCount++ ;
14- args .push ([collection, attributes, callback])
15- callback (null , attributes)
16- return topic
17-
186vows .describe (' Base model (models/model)' ).addBatch (
197 ' ' : {
208 topic : () -> getTopic ()
@@ -43,18 +31,31 @@ vows.describe('Base model (models/model)').addBatch(
4331 }
4432 instance .save (' testCollection' , @callback )
4533
46- ' it should call save() on the base stored object ' : (err , attributes ) ->
34+ ' it should call save() on the base object ' : (err , attributes ) ->
4735 callCount .should .equal (1 )
4836 args .should .have .length (1 )
4937
5038 ' it should pass model.attributes to the save() ' : (err , attributes ) ->
5139 args[0 ].should .have .length (3 )
5240 args[0 ][1 ].should .eql ({ ' one' : true })
5341
54- ' it should pass collection and callback to base object ' : (err , attributes ) ->
42+ ' it should pass collection and callback to base ' : (err , attributes ) ->
5543 args[0 ].should .have .length (3 )
5644 args[0 ][0 ].should .equal (' testCollection' )
5745 args[0 ][2 ].should .not .be .null
5846 }
5947 }
6048).export (module )
49+
50+ callCount = 0
51+ args = []
52+
53+ getTopic = () ->
54+ topic = new Model ()
55+ topic ._adapter =
56+ save : (collection , attributes , callback ) ->
57+ callCount++ ;
58+ args .push ([collection, attributes, callback])
59+ callback (null , attributes)
60+ return topic
61+
0 commit comments