No commit activity in last 3 years
No release in over 3 years
Outputs the command line options to rerun failing tests
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.7
~> 5.0
~> 10.0
 Project Readme

minitest-rerun-options

Outputs the command line options to rerun failing tests

Description

This plugin adds a reporter that outputs command line options for failing tests. As an example:

$ ruby test/test_examples/test_with_failures.rb
Run options: --seed 39171

# Running:

.FF..

Finished in 0.001130s, 4424.7788 runs/s, 4424.7788 assertions/s.

  1) Failure:
TestExample#test_another_that_will_fail [test/test_examples/test_with_failures.rb:14]:
Failed assertion, no message given.


  2) Failure:
TestExample#test_that_will_fail [test/test_examples/test_with_failures.rb:10]:
Failed assertion, no message given.

5 runs, 5 assertions, 2 failures, 0 errors, 0 skips

Rerun failed tests options:
--name TestExample#test_another_that_will_fail
--name TestExample#test_that_will_fail
--names TestExample#test_another_that_will_fail,TestExample#test_that_will_fail

Then you can rerun a single failure: ruby test/test_examples/test_with_failures.rb --name TestExample#test_that_will_fail

Or all failing tests: ruby test/test_examples/test_with_failures.rb --names TestExample#test_another_that_will_fail,TestExample#test_that_will_fail

If you are using Rake, it will output the environment variable that Rake uses:

Rerun failed tests options:
TEST_OPTS="--name TestExample#test_that_will_fail"
TEST_OPTS="--name TestExample#test_another_that_will_fail"
TEST_OPTS="--names TestExample#test_that_will_fail,TestExample#test_another_that_will_fail"

Installation

Add this line to your application's Gemfile:

gem 'minitest-rerun-options'

And then execute:

$ bundle

Or install it yourself as:

$ gem install minitest-rerun-options

And that's it! This is a Minitest plugin which means that it will be autoloaded.

Contributing

  1. Fork it ( https://github.com/ivantsepp/minitest-rerun-options/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request