minitest.el

July 23, 2025 ยท View on GitHub

A minitest mode for emacs

MELPA

Usage

CommandDescriptionMode binding
M-x minitest-verifyRuns minitest test on the current fileC-c , v
M-x minitest-verify-singleRuns minitest test on the selected lineC-c , s
M-x minitest-rerunRuns the last test againC-c , r
M-x minitest-verify-allRuns all the tests in the projectC-c , a

Installation

Manual

Just drop minitest.el. somewhere in your load-path. And:

(require 'minitest)

Using MELPA

M-x package-install minitest

Configuration

To enable minitest mode on ruby files, simply add this hook to your dotfile:

(add-hook 'ruby-mode-hook 'minitest-mode)

Rails

The Rails test runner is invoked using bin/rails test instead of the default minitest command. The minitest-use-rails custom variable can be set to t to invoke the Rails runner.

Docker

You can run tests inside a Docker container by setting minitest-use-docker to t and minitest-docker-container to the name of the container. By default this will use the command docker-compose exec to run the minitest command, which assumes you already have the specified container running. To customize the command, edit the minitest-docker-command variable.

Snippets

If you have yasnippet installed, you can load the snippets:

(eval-after-load 'minitest
  '(minitest-install-snippets))

Scroll Position

If you'd like to automatically scroll to the bottom of the test report, set the compilation-scroll-output variable to t.