Want to write iPhone apps with unit tests? Want to write them in Ruby?
This project adds a Ruby-based unit test framework to your iPhone/Objective-C project. This allows
you to write your unit tests in Ruby (test/unit, rspec, Shoulda, test/spec etc) and have them executed
upon your Objective-C code.
Although iPhone code is normally compiled to the ARM architecture (the iPhone uses ARM, not Intel or PPC chips)
we can test the code on an Intel/PPC machine by compiling it against a combination of standard Mac OSX frameworks
and some iPhone frameworks.
Theoretically you cannot compile Mac OSX code against the iPhone frameworks, since the latter are built against the ARM
architecture. So, this project aims to resolve this issue by generating pretend/mock iPhone classes based on the known,
public iPhone framework header files. Your Ruby tests can then mock out any expected functionality as requred.
NOTE: currently the project does not include the mock iPhone framework classes. Its under development.
But, there are common frameworks between the iPhone and Mac OSX platforms. At last count here are the useful statistics:
There is a generated complete list of Platform Differences.
This means that when you compile your iPhone code against Mac OSX frameworks (which is what you’ll do to test them using
this Ruby-based test framework), there may be inconsistencies in headers and behaviour. But, what you can do at the moment
is better than a kick in the teeth.