Outputs the command line options to rerun failing tests
MIT License
Outputs the command line options to rerun failing tests
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"
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.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)