lib/stub.js
// Invokes the function or method unless the user provided an overrideMethod.
Invokes the function or method unless the user provided an overrideMethod.
Invokes the function or method unless the user provided an overrideMethod .
function spy( objectOrFunction, methodName, overrideMethod ) {
    var args = normalizeArgs(objectOrFunction, methodName, overrideMethod);
    var object = args.ob, methodName = args.me, overrideMethod = args.ov;
    var _spy = stub.stub(object, methodName, overrideMethod || object[methodName] || 'stub')
        .configure('saveLimit', 10);
    return _spy;
}
function spy ( objectOrFunction , methodName , overrideMethod ) { var args = normalizeArgs ( objectOrFunction , methodName , overrideMethod ) ; var object = args . ob , methodName = args . me , overrideMethod = args . ov ; var _spy = stub . stub ( object , methodName , overrideMethod || object [ methodName ] || 'stub' ) . configure ( 'saveLimit' , 10 ) ; return _spy ; }
Invokes the function or method unless the user provided an overrideMethod.
Invokes the function or method unless the user provided an overrideMethod .
// TODO: merge into stub() // if nothing given to spy on, spy on an anonymous stub instead