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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access