arunoda/nodemock — pull request #23 by oscarrenalias (2013-03-31 20:57:55+00:00)
Title: Patch to support functions in takes() and returns()

Added the following:
- takesF: client code can provide a function to determine whether the input is valid or not rather than using static values. The function receives the mocked function's parameters and returns true to allow the call, or false to prevent the cal
- takesAll: uses the method above and provides a function that allows all input parameters
- returnsF: just like takesF, provides client code the possibility to return values dynamically

I have added as many unit test cases as needed to ensure that this new functionality works and that I did not break existing functionality.

The patch also contains:
- integration with Grunt as the task management system
- code cleanup with JShint; mostly basic stuff, but it actually found a bug with proper reporting of parameter values

If you think that this pull request is not ok then I will take the liberty of turning it into an official fork of the project and publish it via npm.org (but with a different name, of course), since I'd very much like to use your library in a few of my projects and it's easier for me to do it via npm.