A Word About Tools, Best Practices, and Teaching TDD

Two test libraries are in general use in the Rails community—Minitest and RSpec—which means I had a choice of which tool to use as the primary library in this book. This book is about how to test Rails in general; therefore, the details of the testing library in use are secondary to most of it. Still, the examples have to be presented using one tool or the other.

Minitest is part of the Ruby Standard Library and is available everywhere you might use Ruby (1.9 and up). It has a straightforward syntax that is the Ruby translation of the original SUnit and JUnit libraries (for Smalltalk and Java, respectively), and it is the default alternative for a new Rails project. Minitest is used by the ...

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.