spyOn explicitly checks to see that a method name to spy on was passed.

[finish #27689237]
This commit is contained in:
slackersoft
2014-12-16 13:21:48 -08:00
parent 7570bc422b
commit b4b3ac25a1
3 changed files with 17 additions and 0 deletions

View File

@@ -9,6 +9,10 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
throw new Error('spyOn could not find an object to spy upon for ' + methodName + '()');
}
if (j$.util.isUndefined(methodName)) {
throw new Error('No method name supplied');
}
if (j$.util.isUndefined(obj[methodName])) {
throw new Error(methodName + '() method does not exist');
}