minitest-reporters - create customizable MiniTest output formats StillMaintained Status Build Status

Death to haphazard monkey-patching! Extend MiniTest through simple hooks.

Installation

gem install minitest-reporters

Usage

In your test_helper.rb file, add the following lines:

require 'minitest/reporters'
MiniTest::Unit.runner = MiniTest::SuiteRunner.new
MiniTest::Unit.runner.reporters << MiniTest::Reporters::ProgressReporter.new

Now, just run your tests; the reporter you specified will be used and make your output look absolutely gorgeous! If you feel the need to write your own reporter, just include MiniTest::Reporter and override the methods you'd like. Take a look at the provided reporters for examples.

The following reporters are provided:

MiniTest::Reporters::DefaultReporter # => Identical to the standard MiniTest reporter
MiniTest::Reporters::SpecReporter # => Turn-like output that reads like a spec
MiniTest::Reporters::ProgressReporter # => Fuubar-like output with a progress bar
MiniTest::Reporters::RubyMateReporter # => Simple reporter designed for RubyMate; see below

I really like ProgressReporter for my everyday terminal usage, but I like using RubyMateReporter when I'm executing test suites from TextMate. My usual set up looks like this:

require 'minitest/reporters'
MiniTest::Unit.runner = MiniTest::SuiteRunner.new
if ENV['TM_PID']
  MiniTest::Unit.runner.reporters << MiniTest::Reporters::RubyMateReporter.new
else
  MiniTest::Unit.runner.reporters << MiniTest::Reporters::ProgressReporter.new
end

TODO

Note on Patches/Pull Requests

Resources

License

Minitest-reporters is licensed under the MIT License. See LICENSE for details.