What You’ve Done

Minitest has a couple of advantages over RSpec. It’s less complex and is often faster in practice. In this chapter you’ve seen how to use Minitest to write unit, system, and integration tests. In many cases, the RSpec functionality is based on the Rails test extensions to Minitest.

In the rest of this book I’ll describe how every new library is set up for both RSpec and Minitest. Although the examples will primarily be RSpec, the sample-code download has analogous Minitest examples for most of them in the test directory of each successive version of the application.

Get Rails 5 Test Prescriptions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.