[Finishes #52959947] Warn user about spy conflicts; Refactor spy tests to more reflect responsibilities and removed duplicate tests
This commit is contained in:
@@ -65,13 +65,17 @@ getJasmineRequireObj().base = function(j$) {
|
||||
return spyStrategy.exec.apply(this, arguments);
|
||||
};
|
||||
|
||||
spy.and = spyStrategy;
|
||||
spy.calls = callTracker;
|
||||
for (var prop in originalFn) {
|
||||
if (prop === 'and' || prop === 'calls') {
|
||||
throw new Error("Jasmine spies would overwrite the 'and' and 'calls' properties on the object being spied upon");
|
||||
}
|
||||
|
||||
for (prop in originalFn) {
|
||||
spy[prop] = originalFn[prop];
|
||||
}
|
||||
|
||||
spy.and = spyStrategy;
|
||||
spy.calls = callTracker;
|
||||
|
||||
return spy;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user