Running Minitest
Learn how to run Minitest. Learn about Minitest directories, files, test method functionalities, and fixture loading.
We'll cover the following...
Rails provides some standard tasks for running all or part of the test suite.
Minitest directories
The one to use most of the time, which is not the Rails default, is rails test
(often bin/rails test
, depending on how our bundle is set up). It grabs any files ending with _test.rb
in the test
directory or any of its subdirectories (except for system tests) and executes them through Minitest. Minitest and Rails use the syntax rails test test/models/task_test.rb
for running a single file or directory. For now, let’s assume we’re using rails test
. In the chapter “ ...