allending/Kiwi — pull request #172 by eraserhd (2012-11-23 02:49:25+00:00)
Title: Avoid need to cast mocks as (id) to call captureArgument:atIndex:

If you do:

RealThing *realThing = [RealThing mock];

You get an error if you try to:

KWCaptureSpy *spy = [realThing captureArgument:@selector(foo:) atIndex:0];

Without this patch, you need to:

KWCaptureSpy *spy = [(id)realThing captureArgument:@selector(foo:) atIndex:0];

This prevents that by adding a category to NSObject. The default implementation throws an exception indicating that you've called captureArgument:atIndex: on a non-mock.