A Word About Tools, Best Practices, and Teaching TDD

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

Minitest is part of the Ruby Standard Library and is therefore 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.

Get Rails 4 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.