|
|
@@ -53,8 +53,8 @@ module.exports = {
|
|
|
"should return the current document source": function currSource(next){
|
|
|
var lds = new LimitDocumentSource();
|
|
|
lds.limit = 1;
|
|
|
- lds.source = {getNext:function(cb){cb({ item:1 });}};
|
|
|
- lds.getNext(function(val) {
|
|
|
+ lds.source = {getNext:function(err,cb){cb(null,{ item:1 });}};
|
|
|
+ lds.getNext(function(err,val) {
|
|
|
assert.deepEqual(val, { item:1 });
|
|
|
next();
|
|
|
});
|
|
|
@@ -65,16 +65,16 @@ module.exports = {
|
|
|
lds.limit = 10;
|
|
|
lds.source = {
|
|
|
calls: 0,
|
|
|
- getNext:function(cb) {
|
|
|
+ getNext:function(err,cb) {
|
|
|
if (lds.source.calls)
|
|
|
- return cb(DocumentSource.EOF);
|
|
|
+ return cb(null,DocumentSource.EOF);
|
|
|
lds.source.calls++;
|
|
|
- return cb({item:1});
|
|
|
+ return cb(null,{item:1});
|
|
|
},
|
|
|
dispose:function() { return true; }
|
|
|
};
|
|
|
lds.getNext(function(){});
|
|
|
- lds.getNext(function(val) {
|
|
|
+ lds.getNext(function(err,val) {
|
|
|
assert.strictEqual(val, DocumentSource.EOF);
|
|
|
next();
|
|
|
});
|
|
|
@@ -85,15 +85,15 @@ module.exports = {
|
|
|
lds.limit = 1;
|
|
|
lds.source = {
|
|
|
calls: 0,
|
|
|
- getNext:function(cb) {
|
|
|
+ getNext:function(err,cb) {
|
|
|
if (lds.source.calls)
|
|
|
- return cb(DocumentSource.EOF);
|
|
|
- return cb({item:1});
|
|
|
+ return cb(null,DocumentSource.EOF);
|
|
|
+ return cb(null,{item:1});
|
|
|
},
|
|
|
dispose:function() { return true; }
|
|
|
};
|
|
|
lds.getNext(function(){});
|
|
|
- lds.getNext(function (val) {
|
|
|
+ lds.getNext(function (err,val) {
|
|
|
assert.strictEqual(val, DocumentSource.EOF);
|
|
|
next();
|
|
|
});
|