If you’ve been using RubyMotion, you probably noticed that some new testing features were released today. The video in the announcment post and the documentation are pretty good, so I’m just going to share a few things that I had to do to get things working.
Both the video and documentation have you add a test environment guard
clause to your
application:didFinishLaunchingWithOptions: method in
the application delegate. Be aware that this will likely cause the
window test in the default
main_spec.rb to fail, so either delete that
or anticipate some test failures due to the initialization changes.
Update 2012/07/14: The
specs_dir is searched recursively now, so the
workaround that was previously in this section is no longer needed.
If you’re using Storyboards, you’ll have to pass the Xcode identifier of
the controller to the
tests method in the
1 2 3 4 5 6 7 8 9 10
You may occasionally see errors like the following.
1 2 3 4 5 6 7 8
I suspect this is the 0.3 second delay condition mentioned in the comments for the functional test code. Clearly the universe is telling me to get the new retina MBP.