Masatoshi Nishiguchi

Setting up Minitest in Rails

This is my memo on Setting up Minitest in Rails.

MiniTest reporters

It gets the default Rails tests to show red and green at the appropriate times.

  1. Include the minitest-reporters gem.
  2. Configure the test by adding these few lines to the test/test_helper.rb file.

Automated tests with Guard

  1. Include the guard gem in the Gemfile.
  2. Initialize it by running $ bundle exec guard init.
  3. Edit the resulting Guardfile so that Guard will run the right tests. [Example]

  4. Open a new terminal and run it at the command line as follows:
$ bundle exec guard # start
$ quit              # exit