Merge branch 'trackReturnValues' of https://github.com/pimterry/jasmine into pimterry-trackReturnValues

This commit is contained in:
slackersoft
2014-09-22 12:50:56 -07:00
4 changed files with 37 additions and 8 deletions

View File

@@ -54,11 +54,16 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
}),
callTracker = new j$.CallTracker(),
spy = function() {
callTracker.track({
var callData = {
object: this,
args: Array.prototype.slice.apply(arguments)
});
return spyStrategy.exec.apply(this, arguments);
};
callTracker.track(callData);
var returnValue = spyStrategy.exec.apply(this, arguments);
callData.returnValue = returnValue;
return returnValue;
};
for (var prop in originalFn) {