One of my personal goals for 2010 is to finally adopt unit testing in my project lifecycles. I’ve long meant to do something like this, but the amount of effort it takes to get a project up and running using Xcode’s OCUnit integration was a big detractor. It’s workflow also left much to be desired as as David Dribin so eloquently radared.
It wasn’t until I discovered Gabriel Handford’s GHUnit that I genuinely got interested in incorporating TDD into my projects. GHUnit is installed as a framework that you can then run as an application in a separate test target. It took about 10 minutes to get setup and writing code.
As I have adopted it into my workflow, I got tired of manually creating new GHTestCase classes or repurposing the default templates to do my bidding. Luckily you can pretty easily extend Xcode to use custom project and file templates. I just posted my GHUnit Test Case template to GitHub, which will create a new GHTestCase subclass as well as the setup and tear down methods. It’s not much, but anything that saves me a few keystrokes a day is a win.

