Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add in a short README and attributions

  • Loading branch information...
commit 0f70765c1f23bf1cd74623c09ff9d71beccd747f 1 parent 8a606be
Alexander Kern authored
View
22 .gitignore
@@ -1,4 +1,22 @@
+coverage
+rdoc
+pkg
+test/tmp
+test/version_tmp
+tmp
+pkg
*.gem
+*.rbc
+lib/bundler/man
+spec/reports
+.config
+InstalledFiles
.bundle
-Gemfile.lock
-pkg/*
+
+# YARD artifacts
+.yardoc
+_yardoc
+doc/
+
+# Gem-specific
+Gemfile.lock
View
6 .yardopts
@@ -0,0 +1,6 @@
+--readme README.md
+--markup markdown
+--markup-provider maruku
+--default-return ""
+--title "Minitest-reporter Documentation"
+--hide-void-return
View
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2011 Alexander Kern
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
44 README.md
@@ -0,0 +1,44 @@
+# minitest-reporter - reporters for MiniTest [![StillMaintained Status](http://stillmaintained.com/CapnKernul/minitest-reporter.png)](http://stillmaintained.com/CapnKernul/minitest-reporter) [![Build Status](http://travis-ci.org/CapnKernul/minitest-reporter.png)](http://travis-ci.org/CapnKernul/minitest-reporter) #
+
+Allows you to extend MiniTest using reporters rather than monkey-patching.
+
+## Installation ##
+
+ gem install minitest-reporter
+
+## Usage ##
+
+Then, in your `test_helper.rb` file, add the following lines:
+
+ 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 subclass `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
+
+I really like `ProgressReporter`.
+
+## Note on Patches/Pull Requests ##
+
+* Fork the project.
+* Make your feature addition or bug fix.
+* Add tests for it. This is important so I don't break it in a future version unintentionally.
+* Commit, but do not mess with the `Rakefile`. If you want to have your own version, that is fine but bump the version in a commit by itself in another branch so I can ignore it when I pull.
+* Send me a pull request. Bonus points for git flow feature branches.
+
+## Resources ##
+
+* [GitHub Repository](https://github.com/CapnKernul/minitest-reporter)
+* [Documentation](http://rubydoc.info/github/CapnKernul/minitest-reporter)
+
+## License ##
+
+Minitest-reporter is licensed under the MIT License. See `LICENSE` for details.
View
11 lib/minitest-reporter.rb
@@ -2,7 +2,14 @@
module MiniTest
require 'minitest-reporter/reporter'
- require 'minitest-reporter/suite_runner'
- require 'minitest-reporter/test_runner'
require 'minitest-reporter/version'
+
+ autoload :SuiteRunner, 'minitest-reporter/suite_runner'
+ autoload :TestRunner, 'minitest-reporter/test_runner'
+
+ module Reporters
+ autoload :DefaultReporter, 'minitest-reporter/reporters/default_reporter'
+ autoload :SpecReporter, 'minitest-reporter/reporters/spec_reporter'
+ autoload :ProgressReporter, 'minitest-reporter/reporters/progress_reporter'
+ end
end
View
16 lib/minitest-reporter/reporter.rb
@@ -8,6 +8,10 @@ def output
runner.output
end
+ def verbose?
+ runner.verbose
+ end
+
def print(*args)
runner.output.print(*args)
end
@@ -16,14 +20,14 @@ def puts(*args)
runner.output.puts(*args)
end
- def before_suites(suites); end
- def after_suites(suites); end
+ def before_suites(suites, type); end
+ def after_suites(suites, type); end
def before_suite(suite); end
def after_suite(suite); end
def before_test(suite, test); end
- def pass(suite, test, runner); end
- def skip(suite, test, runner); end
- def failure(suite, test, runner); end
- def error(suite, test, runner); end
+ def pass(suite, test, test_runner); end
+ def skip(suite, test, test_runner); end
+ def failure(suite, test, test_runner); end
+ def error(suite, test, test_runner); end
end
end
View
103 lib/minitest-reporter/reporters/default_reporter.rb
@@ -0,0 +1,103 @@
+require 'ansi'
+
+module MiniTest
+ module Reporters
+ # A reporter identical to the standard MiniTest reporter.
+ #
+ # Based upon Ryan Davis of Seattle.rb's MiniTest (MIT License).
+ #
+ # @see https://github.com/seattlerb/minitest MiniTest
+ class DefaultReporter < MiniTest::Reporter
+ def before_suites(suites, type)
+ puts
+ puts "# Running #{type}s:"
+ puts
+ end
+
+ def before_test(suite, test)
+ print "#{suite}##{method} = " if verbose?
+ end
+
+ def pass(suite, test, test_runner)
+ after_test('.')
+ end
+
+ def skip(suite, test, test_runner)
+ after_test('S')
+ end
+
+ def failure(suite, test, test_runner)
+ after_test('F')
+ end
+
+ def error(suite, test, test_runner)
+ after_test('E')
+ end
+
+ def after_suites(suites, type)
+ time = Time.now - runner.start_time
+
+ puts
+ puts
+ puts "Finished #{type}s in %.6fs, %.4f tests/s, %.4f assertions/s." %
+ [time, runner.test_count / time, runner.assertion_count / time]
+
+ i = 0
+ runner.report.each do |suite, tests|
+ tests.each do |test, test_runner|
+ message = message_for(test_runner)
+ if message
+ i += 1
+ puts "\n%3d) %s" % [i, message]
+ end
+ end
+ end
+
+ puts
+
+ puts status
+ end
+
+ private
+
+ def after_test(result)
+ time = Time.now - runner.test_start_time
+
+ print '%.2f s = ' % time if verbose?
+ print result
+ puts if verbose?
+ end
+
+ def location(exception)
+ last_before_assertion = ''
+
+ exception.backtrace.reverse_each do |s|
+ break if s =~ /in .(assert|refute|flunk|pass|fail|raise|must|wont)/
+ last_before_assertion = s
+ end
+
+ last_before_assertion.sub(/:in .*$/, '')
+ end
+
+ def message_for(test_runner)
+ suite = test_runner.suite
+ test = test_runner.test
+ e = test_runner.exception
+
+ case test_runner.result
+ when :pass then nil
+ when :skip then "Skipped:\n#{test}(#{suite}) [#{location(e)}]:\n#{e.message}\n"
+ when :failure then "Failure:\n#{test}(#{suite}) [#{location(e)}]:\n#{e.message}\n"
+ when :error
+ bt = MiniTest::filter_backtrace(test_runner.exception.backtrace).join "\n "
+ "Error:\n#{test}(#{suite}):\n#{e.class}: #{e.message}\n #{bt}\n"
+ end
+ end
+
+ def status
+ '%d tests, %d assertions, %d failures, %d errors, %d skips' %
+ [runner.test_count, runner.assertion_count, runner.failures, runner.errors, runner.skips]
+ end
+ end
+ end
+end
View
107 lib/minitest-reporter/reporters/progress_reporter.rb
@@ -0,0 +1,107 @@
+require 'ansi'
+require 'progressbar'
+
+module MiniTest
+ module Reporters
+ # Fuubar-like reporter with a progress bar.
+ #
+ # Based upon Jeff Kreefmeijer's Fuubar (MIT License) and paydro's
+ # monkey-patch.
+ #
+ # @see https://github.com/jeffkreeftmeijer/fuubar Fuubar
+ # @see https://gist.github.com/356945 paydro's monkey-patch
+ class ProgressReporter < MiniTest::Reporter
+ include ANSI::Code
+
+ INFO_PADDING = 2
+
+ def before_suites(suites, type)
+ puts 'Started'
+ puts
+
+ @color = GREEN
+ @finished_count = 0
+ @progress = ProgressBar.new("0/#{runner.test_count}", runner.test_count, runner.output)
+ @progress.bar_mark = '='
+ end
+
+ def increment
+ with_color do
+ @finished_count += 1
+ @progress.instance_variable_set('@title', "#{@finished_count}/#{runner.test_count}")
+ @progress.inc
+ end
+ end
+
+ def pass(suite, test, test_runner)
+ increment
+ end
+
+ def skip(suite, test, test_runner)
+ @color = YELLOW unless @color == RED
+ print(yellow { 'SKIP' })
+ print_test_with_time(suite, test)
+ puts
+ puts
+ increment
+ end
+
+ def failure(suite, test, test_runner)
+ @color = RED
+ print(red { 'FAIL' })
+ print_test_with_time(suite, test)
+ puts
+ print_info(test_runner.exception)
+ puts
+ increment
+ end
+
+ def error(suite, test, test_runner)
+ @color = RED
+ print(red { 'ERROR' })
+ print_test_with_time(suite, test)
+ puts
+ print_info(test_runner.exception)
+ puts
+ increment
+ end
+
+ def after_suites(suites, type)
+ with_color { @progress.finish }
+
+ total_time = Time.now - runner.start_time
+
+ puts
+ puts('Finished in %.5fs' % total_time)
+ print('%d tests, %d assertions, ' % [runner.test_count, runner.assertion_count])
+ print(red { '%d failures, %d errors, ' } % [runner.failures, runner.errors])
+ print(yellow { '%d skips' } % runner.skips)
+ puts
+ end
+
+ private
+
+ def print_test_with_time(suite, test)
+ total_time = Time.now - runner.test_start_time
+ print(" #{suite}##{test} (%.2fs)#{clr}" % total_time)
+ end
+
+ def print_info(e)
+ e.message.each_line { |line| puts pad(line) }
+
+ trace = MiniTest.filter_backtrace(e.backtrace)
+ trace.each { |line| puts pad(line) }
+ end
+
+ def pad(str)
+ ' ' * INFO_PADDING + str
+ end
+
+ def with_color
+ print @color
+ yield
+ print CLEAR
+ end
+ end
+ end
+end
View
92 lib/minitest-reporter/reporters/spec_reporter.rb
@@ -0,0 +1,92 @@
+require 'ansi'
+
+module MiniTest
+ module Reporters
+ # Turn-like reporter that reads like a spec.
+ #
+ # Based upon TwP's turn (MIT License) and paydro's monkey-patch.
+ #
+ # @see https://github.com/TwP/turn turn
+ # @see https://gist.github.com/356945 paydro's monkey-patch
+ class SpecReporter < MiniTest::Reporter
+ include ANSI::Code
+
+ TEST_PADDING = 2
+ INFO_PADDING = 8
+ MARK_SIZE = 5
+
+ def before_suites(suites, type)
+ puts 'Started'
+ puts
+ end
+
+ def after_suites(suites, type)
+ total_time = Time.now - runner.start_time
+
+ puts('Finished in %.5fs' % total_time)
+ print('%d tests, %d assertions, ' % [runner.test_count, runner.assertion_count])
+ print(red { '%d failures, %d errors, ' } % [runner.failures, runner.errors])
+ print(yellow { '%d skips' } % runner.skips)
+ puts
+ end
+
+ def before_suite(suite)
+ puts suite
+ end
+
+ def after_suite(suite)
+ puts
+ end
+
+ def pass(suite, test, test_runner)
+ print(green { pad_mark('PASS') })
+ print_test_with_time(test)
+ puts
+ end
+
+ def skip(suite, test, test_runner)
+ print(yellow { pad_mark('SKIP') })
+ print_test_with_time(test)
+ puts
+ end
+
+ def failure(suite, test, test_runner)
+ print(red { pad_mark('FAIL') })
+ print_test_with_time(test)
+ puts
+ print_info(test_runner.exception)
+ puts
+ end
+
+ def error(suite, test, test_runner)
+ print(red { pad_mark('ERROR') })
+ print_test_with_time(test)
+ puts
+ print_info(test_runner.exception)
+ puts
+ end
+
+ private
+
+ def print_test_with_time(test)
+ total_time = Time.now - runner.test_start_time
+ print(" #{test} (%.2fs)" % total_time)
+ end
+
+ def print_info(e)
+ e.message.each_line { |line| puts pad(line, INFO_PADDING) }
+
+ trace = MiniTest.filter_backtrace(e.backtrace)
+ trace.each { |line| puts pad(line, INFO_PADDING) }
+ end
+
+ def pad(str, size)
+ ' ' * size + str
+ end
+
+ def pad_mark(str)
+ pad("%#{MARK_SIZE}s" % str, TEST_PADDING)
+ end
+ end
+ end
+end
View
58 lib/minitest-reporter/suite_runner.rb
@@ -1,14 +1,15 @@
module MiniTest
+ # Runner for MiniTest suites.
+ #
+ # This is a heavily refactored version of the built-in MiniTest runner. It's
+ # about the same speed, from what I can tell, but is significantly easier to
+ # extend.
+ #
+ # Based upon Ryan Davis of Seattle.rb's MiniTest (MIT License).
+ #
+ # @see https://github.com/seattlerb/minitest MiniTest
class SuiteRunner < Unit
- class << self
- attr_writer :reporters
-
- def reporters
- @reporters ||= []
- end
- end
-
- attr_accessor :suite_start_time, :test_start_time
+ attr_accessor :suite_start_time, :test_start_time, :reporters
def initialize
self.report = {}
@@ -18,6 +19,7 @@ def initialize
self.test_count = 0
self.assertion_count = 0
self.verbose = false
+ self.reporters = []
end
def _run_anything(type)
@@ -32,30 +34,32 @@ def _run_anything(type)
self.test_count = tests.inject(0) { |acc, suite| acc + suite[1].length }
if test_count > 0
- trigger(:before_suites, suites)
- fix_sync { _run_suites(suites, type) }
- trigger(:after_suites, suites)
+ trigger(:before_suites, suites, type)
+
+ fix_sync do
+ suites.each { |suite| _run_suite(suite, tests[suite]) }
+ end
+
+ trigger(:after_suites, suites, type)
end
end
- def _run_suite(suite, type)
- tests = filtered_tests(suite, type)
-
+ def _run_suite(suite, tests)
unless tests.empty?
- self.suite_start_time = Time.now
- trigger(:before_suite, suite)
- _run_tests(suite, tests)
- trigger(:after_suite, suite)
+ begin
+ self.suite_start_time = Time.now
+
+ trigger(:before_suite, suite)
+ suite.startup if suite.respond_to?(:startup)
+
+ tests.each { |test| _run_test(suite, test) }
+ ensure
+ suite.shutdown if suite.respond_to?(:shutdown)
+ trigger(:after_suite, suite)
+ end
end
end
- def _run_tests(suite, tests)
- suite.startup if suite.respond_to?(:startup)
- tests.each { |test| _run_test(suite, test) }
- ensure
- suite.shutdown if suite.respond_to?(:shutdown)
- end
-
def _run_test(suite, test)
self.test_start_time = Time.now
trigger(:before_test, suite, test)
@@ -68,7 +72,7 @@ def _run_test(suite, test)
end
def trigger(callback, *args)
- self.class.reporters.each { |reporter| reporter.send(callback, *args) }
+ reporters.each { |reporter| reporter.send(callback, *args) }
end
private
View
8 lib/minitest-reporter/test_runner.rb
@@ -1,4 +1,12 @@
module MiniTest
+ # Runner for individual MiniTest tests.
+ #
+ # You *should not* create instances of this class directly. Instances of
+ # {SuiteRunner} will create these and send them to the reporters.
+ #
+ # Based upon Ryan Davis of Seattle.rb's MiniTest (MIT License).
+ #
+ # @see https://github.com/seattlerb/minitest MiniTest
class TestRunner
attr_reader :suite, :test, :assertions, :result, :exception
View
4 minitest-reporter.gemspec
@@ -9,8 +9,8 @@ Gem::Specification.new do |s|
s.authors = ['Alexander Kern']
s.email = ['alex@kernul.com']
s.homepage = 'https://github.com/CapnKernul/minitest-reporter'
- s.summary = %q{Adds reporters to MiniTest}
- s.description = %q{Allows you to extend MiniTest::Unit using reporters rather than monkey-patching}
+ s.summary = %q{Reporters for MiniTest}
+ s.description = %q{Allows you to extend MiniTest using reporters rather than monkey-patching}
s.rubyforge_project = 'minitest-reporter'
View
13 test/minitest-reporter/reporter_test.rb
@@ -14,13 +14,24 @@ def setup
end
test '#runner' do
- assert_instance_of MiniTest::Unit, @reporter.runner
+ assert_kind_of MiniTest::Unit, @reporter.runner
end
test '#output' do
assert_equal MiniTest::Unit.output, @reporter.output
end
+ test '#verbose?' do
+ refute @reporter.verbose?
+
+ begin
+ @reporter.runner.verbose = true
+ assert @reporter.verbose?
+ ensure
+ @reporter.runner.verbose = false
+ end
+ end
+
test '#print' do
@reporter.output.expects(:print).with('foo')
@reporter.print('foo')
View
69 test/minitest-reporter/suite_runner_test.rb
@@ -11,11 +11,11 @@ def setup
assert_equal({}, @runner.report)
end
- test '.reporters' do
- assert_equal [@reporter], MiniTest::SuiteRunner.reporters
+ test '#reporters' do
+ assert_equal [@reporter], @runner.reporters
reporter2 = add_reporter
- assert_equal [@reporter, reporter2], MiniTest::SuiteRunner.reporters
+ assert_equal [@reporter, reporter2], @runner.reporters
end
test '#_run_anything with no suites' do
@@ -36,8 +36,8 @@ def setup
suites = [Fixtures::PassTestFixture, Fixtures::SkipTestFixture]
stub_suites(suites)
- @reporter.expects(:before_suites).with(suites)
- @reporter.expects(:after_suites).with(suites)
+ @reporter.expects(:before_suites).with(suites, :test)
+ @reporter.expects(:after_suites).with(suites, :test)
@runner._run_anything(:test)
@@ -49,88 +49,77 @@ def setup
assert_equal :skip, @runner.report[Fixtures::SkipTestFixture][:test_skip].result
end
+ test '#_run_anything with a filter' do
+ @runner.options[:filter] = '/foo/'
+ stub_suites([Fixtures::PassTestFixture])
+
+ @runner._run_anything(:test)
+ assert_equal 2, @runner.assertion_count
+ end
+
test '#_run_suite without tests' do
@reporter.expects(:before_suite).never
@reporter.expects(:after_suite).never
- @runner._run_suite(Fixtures::EmptyTestFixture, :test)
-
- assert_nil @runner.suite_start_time
+ @runner._run_suite(Fixtures::EmptyTestFixture, [])
end
test '#_run_suite with tests' do
@reporter.expects(:before_suite).with(Fixtures::PassTestFixture)
@reporter.expects(:after_suite).with(Fixtures::PassTestFixture)
- @runner._run_suite(Fixtures::PassTestFixture, :test)
+ @runner._run_suite(Fixtures::PassTestFixture, [:test_pass, :test_foo])
assert_equal 3, @runner.assertion_count
assert_instance_of Time, @runner.suite_start_time
end
- test '#_run_suite with a filter' do
- @runner.options[:filter] = '/foo/'
- @runner._run_suite(Fixtures::PassTestFixture, :test)
- assert_equal 2, @runner.assertion_count
- end
-
- test '#_run_tests without a suite .startup and .shutdown' do
- @runner._run_tests(Fixtures::PassTestFixture, [:test_pass, :test_foo])
- assert_equal 3, @runner.assertion_count
- end
-
- test '#_run_tests with a suite .startup and .shutdown' do
+ test '#_run_suite with a suite .startup and .shutdown' do
suite = Fixtures::SuiteCallbackTestFixture
suite.expects(:startup)
suite.expects(:shutdown)
- @runner._run_tests(suite, [:test_foo])
+ @runner._run_suite(suite, [:test_foo])
end
test '#_run_test with a passing test' do
suite = Fixtures::PassTestFixture
test = :test_pass
-
- @runner.report = {}
- @runner.assertion_count = 0
-
+
@reporter.expects(:before_test).with(suite, test)
@reporter.expects(:pass).with(suite, test, instance_of(MiniTest::TestRunner))
@runner._run_test(suite, test)
assert_equal 1, @runner.assertion_count
+ assert_instance_of Time, @runner.test_start_time
assert_equal :pass, @runner.report[suite][test].result
end
test '#_run_test with a skipped test' do
suite = Fixtures::SkipTestFixture
test = :test_skip
-
- @runner.report = {}
- @runner.assertion_count = 0
-
+
@reporter.expects(:before_test).with(suite, test)
@reporter.expects(:skip).with(suite, test, instance_of(MiniTest::TestRunner))
@runner._run_test(suite, test)
assert_equal 0, @runner.assertion_count
+ assert_instance_of Time, @runner.test_start_time
assert_equal :skip, @runner.report[suite][test].result
end
test '#_run_test with a failing test' do
suite = Fixtures::FailureTestFixture
test = :test_failure
-
- @runner.report = {}
- @runner.assertion_count = 0
-
+
@reporter.expects(:before_test).with(suite, test)
@reporter.expects(:failure).with(suite, test, instance_of(MiniTest::TestRunner))
@runner._run_test(suite, test)
assert_equal 0, @runner.assertion_count
+ assert_instance_of Time, @runner.test_start_time
assert_equal :failure, @runner.report[suite][test].result
end
@@ -138,15 +127,13 @@ def setup
suite = Fixtures::ErrorTestFixture
test = :test_error
- @runner.report = {}
- @runner.assertion_count = 0
-
@reporter.expects(:before_test).with(suite, test)
@reporter.expects(:error).with(suite, test, instance_of(MiniTest::TestRunner))
@runner._run_test(suite, test)
assert_equal 0, @runner.assertion_count
+ assert_instance_of Time, @runner.test_start_time
assert_equal :error, @runner.report[suite][test].result
end
@@ -158,18 +145,16 @@ def setup
@runner.trigger(:before_suite, Fixtures::PassTestFixture)
end
+ private
+
def add_reporter
reporter = MiniTest::Reporter.new
- MiniTest::SuiteRunner.reporters << reporter
+ @runner.reporters << reporter
reporter
end
def stub_suites(suites)
MiniTest::Unit::TestCase.stubs(:test_suites).returns(suites)
end
-
- def teardown
- MiniTest::SuiteRunner.reporters = []
- end
end
end
View
32 test/test_helper.rb
@@ -5,15 +5,29 @@
require 'minitest-reporter'
module MiniTestReporterTest
- require './test/support/test_case'
+ require File.expand_path('../support/test_case', __FILE__)
module Fixtures
- require './test/support/fixtures/test_case_fixture'
- require './test/support/fixtures/empty_test_fixture'
- require './test/support/fixtures/error_test_fixture'
- require './test/support/fixtures/failure_test_fixture'
- require './test/support/fixtures/pass_test_fixture'
- require './test/support/fixtures/skip_test_fixture'
- require './test/support/fixtures/suite_callback_test_fixture'
+ require File.expand_path('../support/fixtures/test_case_fixture', __FILE__)
+ require File.expand_path('../support/fixtures/empty_test_fixture', __FILE__)
+ require File.expand_path('../support/fixtures/error_test_fixture', __FILE__)
+ require File.expand_path('../support/fixtures/failure_test_fixture', __FILE__)
+ require File.expand_path('../support/fixtures/pass_test_fixture', __FILE__)
+ require File.expand_path('../support/fixtures/skip_test_fixture', __FILE__)
+ require File.expand_path('../support/fixtures/suite_callback_test_fixture', __FILE__)
end
-end
+end
+
+MiniTest::Unit.runner = MiniTest::SuiteRunner.new
+
+# Testing the built-in reporters using automated unit testing would be extremely
+# brittle. Consequently, there are no unit tests for them. Instead, uncomment
+# the reporter that you'd like to test and run the full test suite. Make sure to
+# try them with skipped, failing, and error tests as well!
+#
+# Personally, I like the progress reporter. Make sure you don't change that line
+# when you commit.
+#
+# MiniTest::Unit.runner.reporters << MiniTest::Reporters::DefaultReporter.new
+# MiniTest::Unit.runner.reporters << MiniTest::Reporters::SpecReporter.new
+MiniTest::Unit.runner.reporters << MiniTest::Reporters::ProgressReporter.new
Please sign in to comment.
Something went wrong with that request. Please try again.