Minitest + all the features you always wanted.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets
bin mtest Oct 12, 2014
gemfiles
lib
spec
.travis.yml support minitest 5.10 Dec 1, 2016
Gemfile
Gemfile.lock v2.4.0 Dec 9, 2016
MIT-LICENSE initial by http://github.com/grosser/project_template Oct 12, 2014
Rakefile
Readme.md self host assets Dec 30, 2016
maxitest.gemspec

Readme.md

Minitest + all the features you always wanted.

Failure

Features

  • Ctrl+c stops tests and prints failures
  • pastable rerun snippet for failures (disabled/integrated on rails 5)
  • multiple before & after blocks
  • around blocks around { |t| Dir.chdir(...) { t.call } }
  • red-green output (disabled/integrated on rails 5)
  • mtest executable to run by line number and by folder (disabled/integrated on rails 5)
  • full backtrace for errors and assertions with verbose (-v)
  • let!
  • let_all execute once for all tests in a class and it's subclasses
  • order_dependent! to make your tests run in given order
  • Maxitest.static_class_order = true no longer sort tests class/sub-classes in random order
  • context for more expression
  • pending { assert false } is skip when it fails, but fails when it passes
  • implicit subject via require 'maxitest/implicit_subject'
  • xit to skip test (also does not call setup or teardown)
  • require 'maxitest/timeout' to make hanging tests fail after Maxitest.timeout seconds

Install

gem install maxitest

Usage

require "maxitest/autorun"

... normal tests ...

Development

  • everything vendored into 1 gem to avoid dependency madness
  • tested via rspec to avoid messing up our own tests by accident
  • fixes should go back to the original libraries
  • restrictive minitest dependency so nothing breaks by accident
  • ruby 1.9+
  • rake update to update all vendored gems

TODO

  • make ctrl+c fix its own gem
  • before :all / after :all / around :all
  • minitest 4 version for those stuck on rails 3

Author

Michael Grosser
michael@grosser.it
License: MIT
Build Status