Want to write iPhone apps with unit tests? Want to write them in Ruby?
Installs a Ruby-based unit testing framework into an iPhone/Objective-C/Xcode project
Provides generators to create Objective-C classes with associated Ruby tests
Currently only test/unit tests created; rspec etc coming soon
Currently only supports Foundation framework, since its common between OS X and iPhone
The plan is to mock out all the UIKit.framework classes so they can exist in RubyCocoa land.
Create a new iPhone project using Xcode templates
Open the terminal
Change to project folder
This adds the test framework, a Rakefile, and an `autotest` config file.
You can now create testable Objective-C models/classes using the generator: $ script/generate model WidgetMaker create Classes/WidgetMaker.h create Classes/WidgetMaker.m create test/test_widget_maker.rb
To run tests you have several options:
`rake` or `rake test`
`autotest` (after installing the ZenTest gem)
All options will re-build the Objective-C code (if necessary) before running the tests.
If using autotest, your tests will be re-run if the test files or the Objective-C files are modified.
RubyCocoa (installed on OS X Leopard; latest version at rubycocoa.com)
XCode 3.1 (containing the iPhone SDK)
sudo gem install iphoneruby (COMING SOON)
From source: git clone git://github.com/drnic/iphoneruby.git cd iphoneruby rake install_gem
(The MIT License)
Copyright © 2008 Dr Nic Williams
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.