pivotal/jasmine — pull request #474 by pimterry (2013-12-08 14:02:42+00:00)
Title: Track return values in spy calls

When you're spying on functions which return things, it's occasionally extremely useful to be able to see what those calls returned, particularly with callThrough and callFake. This patch adds return value tracking so you can do that.

I have made the actual implementation (base.js) for this slightly more complicated than it might need to be to keep current behaviour, where you can examine spy.calls and see the current call while you're currently executing it (in a callFake, for example), as the track() call happens before the spyStrategy.exec call. Very happy to simplify that if you're happy to change that behaviour though!

I'd update the docs for this too, but I can't see them anywhere...