cjohansen/Sinon.JS — pull request #131 by teknynja (2012-05-22 16:28:58+00:00)
Title: Allow mocks to use .withArgs and .withExactArgs with no arguments

Currently, if I write a test using .withArgs() or .withExactArgs() passing no arguments, it fails regardless of how many parameters are passed to the method under test (a bit useless if you ask me). I would expect that if I write a test using .withExactArgs() that I am saying I expect exactly zero arguments to be passed - no more or no less. Currently, the framework fails the test with "hide received no arguments, expected" (note that nothing follows "expected").

This change allows passing of empty arguments to .withArgs & .withExactArgs, and using .withExactArgs to specify that the method is called with no arguments. Using .withArgs with no arguments after this change does not cause the test to fail, but it is implying the method is called with zero or more arguments, so it will never fail a test.