O'Reilly logo

RubyMotion by Clay Allsopp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Constructing Basic Tests

The simplest tests are designed to test just one component of our code at a time, independent of how it interacts with other classes or the global state of our app. Tests consist of simple assertions such as object equality or existence. If any of our assertions fail, then the entire test fails and stops executing. We’re going to write some simple tests for an app and go through some common use cases you might run into.

Let’s create a new RubyMotion project with motion create TestFun. Remember way back in Chapter 1, Creating a New App when we discussed the default files and folders motion create generates? Well, we’re going to take a look at one folder we previously neglected: spec.

RubyMotion reads your tests ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required