¶ ↑
MiniTapWebsite | Documentation | Development
¶ ↑
DescriptionThe MiniTap project provides a TAP-Y and TAP-J output reporters for the MiniTest test framework –the test framework that comes standard with Ruby 1.9+.
See TAPOUT for more information about TAP-Y/J formats.
¶ ↑
UsageMiniTest supports custom report format by setting ‘MiniTest::Unit.runner` to an instance of a custom runner class. In this case we want to set it to an instance of `MiniTest::TapY` or `MiniTest::TapJ`. So in your project’s test helper script add, e.g.
require 'minitap' MiniTest::Unit.runner = MiniTest::TapY.new
Now you may want to set this up so it is selectable. In which case use an environment variable.
MiniTest::Unit.runner = \ case ENV['rpt'] when 'tapy' MiniTest::TapY.new when 'tapj' MiniTest::TapJ.new end
Then you can do, e.g.
$ rpt=tapy ruby test/some_test.rb
Now to do something interesting with the TAP-Y/J output, you will probably want to install ‘tapout`:
$ gem install tapout
Then pipe the output to the ‘tapout` command, e.g.
$ rpt=tapy ruby test/some_test.rb | tapout progressbar
¶ ↑
CopyingCopyright © 2011 Thomas Sawyer
Made available under the terms of the BSD-2-Clause license.
Portions of this program were drawn from Alexander Kern’s MiniTest Reporter © 2011 Alexander Kern. Thanks Alexander for making my endeavor a little bit easier.
See COPYING.rdoc for copyright and licensing details.