views:

89

answers:

0

I was reviewing JSMock, and admittedly the most complete documentation I've found are the examples at http://jsmock.sourceforge.net/examples/. I have some questions about argument matching.

The example at http://jsmock.sourceforge.net/examples/ demonstrates argument matching using the TypeOf.isA(). I wonder, are there any other matchers besides isA()? Something that accepts an anonymous function perhaps? It seems limited that I can only match against a fixed value or a type. I would like to be able to pass in an anonymous comparison function, like Moq's It.Is<TValue>(Predicate<TValue>).

I liked the custom argument matcher presented in http://digitalmihailo.blogspot.com/2008/07/extend-jsmock-to-support-custom.html. However I do not think I should patch the JSMock sourcecode in case it were to ever be updated.