Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

52 lines (29 sloc) 1.377 kb


MiniTest integration for Rails 3.1.


gem install minitest-rails

This installs the following gems:



Create a new rails app without Test::Unit:

rails new MyApp --skip-test-unit

Add minitest-rails to the :test and :development groups in Isolate:

env :development, :test do
  gem 'minitest-rails'

Or, for the unenlightened, add minitest-rails to the :test and :development groups in Gemfile:

group :test, :development do
  gem 'minitest-rails'

Next run the installation generator with the following:

rails generate mini_test:install

This will add the minitest_helper.rb file to the test directory.


We aim to expose MiniTest with minimal changes for testing within Rails. You can either create test classes that inherit from MiniTest::Unit::TestCase or you can use the MiniTest::Spec DSL. You can generate tests when you use the standard model, controller, scaffold, and other generators:

rails generate model User

Or, you can use the MiniTest generators directly:

rails generate mini_test::model User

And you can specify generating the tests using the MiniTest::Spec DSL on any of the generators by providing the --spec option:

rails generate model User --spec
Jump to Line
Something went wrong with that request. Please try again.