allending/Kiwi — pull request #384 by csky-ios (2013-09-27 01:02:02+00:00)
Title: Adding tests and fixing issues related to KWCaptureSpy, KWMessagePattern, block based stubs, 

These commits fix some issues that I found in Kiwi while implementing tests for some fairly complicated code. For all the fixes I made I first added a failing test that demonstrated the issue.

The one change that I made that is not demonstrated by a test is the re-write of the KWObjCTypeLength function in the KWObjCUtilities.m file. However many tests depend on this so it should be covered. The previous method was somewhat hacky (using an NSMethodSignature instance to determine the size of a type), and I simply converted it to use the proper runtime methods.

It is worth noting that the issue I resolved in f8c202b was somewhat disconcerting. It appears that the ARC version of the KWCaptureSpy was not properly retaining the argument it was capturing. By the time I tracked down the issue I didn't have a significant amount of time to spend figuring it out, so I reworked the KWCaptureSpy to no longer use ARC. This did resolve the issue, but is obviously not the ideal solution.