Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TDD for an OSX app

Are there any good solutions out there for TDD of a MacOSX Objective-c app?

EDIT: more info

I would really like something similar to rSpec from the Ruby world. Is the XCode built in stuff sufficient? I have heard that it is not. I would like something that supports Mocks, Stubs, and most/all of the test conditions supplied by rSpec (or similar test conditions).

like image 671
Joe Cannatti Avatar asked Jul 19 '10 21:07

Joe Cannatti


2 Answers

Yes, TDD is easy to do with Xcode as it includes unit testing out of the box (OCUnit was included in Xcode 2.1). See Apple's documentation and Xcode Unit Testing Guide for closer details on how to develop and run unit tests in Xcode.

like image 159
Markus Miller Avatar answered Oct 14 '22 07:10

Markus Miller


There's nothing like RSpec (yet) for Objective-C, but the xUnit-style frameworks SenTest/OCUnit (included with Xcode), Google Toolbox for Mac's unit testing additions to OCUnit and GHUnit are all very good. You can do BDD-style with them as well.

If you're really committed to RSpec, you may want to investigate MacRuby. Although it may feel a little heavy in an Objective-C project, you can load your Objective-C framework(s) and run your unit tests in RSpec via MacRuby.

like image 40
Barry Wark Avatar answered Oct 14 '22 08:10

Barry Wark