Saturday, October 13, 2012

Testing Private Methods with Kiwi

I recently had a good reason to test a private method in an Objective-C class (a delegate method that is only called by a 3rd party framework) and a good reason to keep the method private (only the object for which I am providing a delegate should be calling me.)

It turns out that it is easy to test private methods and properties using Kiwi: You use a category in the Spec class to do this.

I learned this in Daniel Steinberg's book "Test Driving iOS Development with Kiwi"

Technorati Tags: , , , ,