@@ -60,17 +60,20 @@ MockMessaging.prototype.autoFlush = function (delay) {
6060} ;
6161
6262MockMessaging . prototype . failNext = function ( methodName , err ) {
63+ assert ( _ . isString ( methodName ) , 'methodName must be a string' ) ;
6364 assert ( err instanceof Error , 'err must be an "Error" object' ) ;
6465 this . results [ methodName ] = err ;
6566} ;
6667
67- MockMessaging . prototype . nextResult = function ( methodName , result ) {
68+ MockMessaging . prototype . respondNext = function ( methodName , result ) {
69+ assert ( _ . isString ( methodName ) , 'methodName must be a string' ) ;
6870 assert ( ! _ . isUndefined ( result ) , 'result must not be undefined' ) ;
6971 assert ( ! ( result instanceof Error ) , 'result must not be an "Error" object' ) ;
7072 this . results [ methodName ] = result ;
7173} ;
7274
7375MockMessaging . prototype . on = function ( methodName , callback ) {
76+ assert ( _ . isString ( methodName ) , 'methodName must be a string' ) ;
7477 assert ( _ . isFunction ( callback ) , 'callback must be a function' ) ;
7578 this . callbacks [ methodName ] = callback ;
7679} ;
@@ -101,9 +104,9 @@ MockMessaging.prototype._invokeOn = function(methodName, args) {
101104} ;
102105
103106MockMessaging . prototype . _nextResult = function ( type ) {
104- var err = this . results [ type ] ;
107+ var result = this . results [ type ] ;
105108 delete this . results [ type ] ;
106- return err || null ;
109+ return result || null ;
107110} ;
108111
109112MockMessaging . prototype . _defer = function ( sourceMethod , sourceArgs , callback ) {
0 commit comments