Allow createSpyObj to be called with just an array of method names
[Finish #50757607] #321
This commit is contained in:
@@ -105,6 +105,11 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
||||
};
|
||||
|
||||
j$.createSpyObj = function(baseName, methodNames) {
|
||||
if (j$.isArray_(baseName) && j$.util.isUndefined(methodNames)) {
|
||||
methodNames = baseName;
|
||||
baseName = 'unknown';
|
||||
}
|
||||
|
||||
if (!j$.isArray_(methodNames) || methodNames.length === 0) {
|
||||
throw 'createSpyObj requires a non-empty array of method names to create spies for';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user