devdazed/supermock — pull request #2 by n2liquid (2013-06-23 21:42:34+00:00)
Title: Anything / Etc feature for assertCalledWith

Mr. Russ, you might be interested in merging these very brief changes into your repo. It allows assertCalledWith to skip comparison of certain arguments (by passing SuperMock.Anything as the expected argument) as well as skip any further arguments (by passing SuperMock.Etc).

Examples:

mocked_obj.on.assertCalledWith('some_event', SuperMock.Etc); // passes even if 'on' is called with lots of arguments, as long as the first one equals 'some_event'
mocked_obj.doSomethingGreat.assertCalledWith(1, 2, SuperMock.Anything, 4); // passes if call was 1, 2, 'three', 4

Anything and Etc can be used together no problem. Etc will also pass if there were no arguments left for comparing.

I hope it'll as useful to you as it is to me. I wrote this because there's no way I could use it with event handlers since I'd have to specify the precise callback used, however I'm sure it'll be useful for other stuff as well.

Thanks for the handy lib.