Permalink
Browse files

Rename journo to minitest-reporters.

  • Loading branch information...
1 parent cd99185 commit e7d498864709c27be588e8f70f97439d5195a8e4 Alexander Kern committed Aug 27, 2011
View
@@ -2,5 +2,5 @@
--markup markdown
--markup-provider maruku
--default-return ""
---title "Minitest-reporter Documentation"
+--title "Minitest-reporters Documentation"
--hide-void-return
View
@@ -1,29 +1,29 @@
-# journo - reporters for MiniTest [![StillMaintained Status](http://stillmaintained.com/CapnKernul/journo.png)](http://stillmaintained.com/CapnKernul/journo) [![Build Status](http://travis-ci.org/CapnKernul/journo.png)](http://travis-ci.org/CapnKernul/journo) #
+# minitest-reporters - create customizable MiniTest output formats [![StillMaintained Status](http://stillmaintained.com/CapnKernul/minitest-reporters.png)](http://stillmaintained.com/CapnKernul/minitest-reporters) [![Build Status](http://travis-ci.org/CapnKernul/minitest-reporters.png)](http://travis-ci.org/CapnKernul/minitest-reporters) #
-Allows you to extend MiniTest using reporters rather than monkey-patching.
+Death to haphazard monkey-patching! Extend MiniTest through simple hooks.
## Installation ##
- gem install journo
+ gem install minitest-reporters
## Usage ##
In your `test_helper.rb` file, add the following lines:
- require 'journo'
- MiniTest::Unit.runner = Journo::SuiteRunner.new
- MiniTest::Unit.runner.reporters << Journo::Reporters::ProgressReporter.new
+ require 'minitest/reporters'
+ 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 `Journo::Reporter` and override the methods you'd
-like. Take a look at the provided reporters for examples.
+reporter, just `include MiniTest::Reporter` and override the methods you'd like.
+Take a look at the provided reporters for examples.
The following reporters are provided:
- Journo::Reporters::DefaultReporter # => Identical to the standard MiniTest reporter
- Journo::Reporters::SpecReporter # => Turn-like output that reads like a spec
- Journo::Reporters::ProgressReporter # => Fuubar-like output with a progress bar
+ 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`.
@@ -37,9 +37,9 @@ I really like `ProgressReporter`.
## Resources ##
-* [GitHub Repository](https://github.com/CapnKernul/journo)
-* [Documentation](http://rubydoc.info/github/CapnKernul/journo)
+* [GitHub Repository](https://github.com/CapnKernul/minitest-reporters)
+* [Documentation](http://rubydoc.info/github/CapnKernul/minitest-reporters)
## License ##
-Journo is licensed under the MIT License. See `LICENSE` for details.
+Minitest-reporters is licensed under the MIT License. See `LICENSE` for details.
View
@@ -1,15 +0,0 @@
-require 'minitest/unit'
-
-module Journo
- require 'journo/version'
-
- autoload :Reporter, 'journo/reporter'
- autoload :SuiteRunner, 'journo/suite_runner'
- autoload :TestRunner, 'journo/test_runner'
-
- module Reporters
- autoload :DefaultReporter, 'journo/reporters/default_reporter'
- autoload :SpecReporter, 'journo/reporters/spec_reporter'
- autoload :ProgressReporter, 'journo/reporters/progress_reporter'
- end
-end
View
@@ -1,3 +0,0 @@
-module Journo
- VERSION = '0.2.0'
-end
@@ -1,7 +1,5 @@
-module Journo
- class Reporter
- VERSION = '0.1.0'
-
+module MiniTest
+ module Reporter
def runner
MiniTest::Unit.runner
end
View
@@ -0,0 +1,15 @@
+require 'minitest/unit'
+
+module MiniTest
+ autoload :Reporter, 'minitest/reporter'
+ autoload :SuiteRunner, 'minitest/suite_runner'
+ autoload :TestRunner, 'minitest/test_runner'
+
+ module Reporters
+ require 'minitest/reporters/version'
+
+ autoload :DefaultReporter, 'minitest/reporters/default_reporter'
+ autoload :SpecReporter, 'minitest/reporters/spec_reporter'
+ autoload :ProgressReporter, 'minitest/reporters/progress_reporter'
+ end
+end
@@ -1,13 +1,15 @@
require 'ansi'
-module Journo
+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 < Journo::Reporter
+ class DefaultReporter
+ include MiniTest::Reporter
+
def before_suites(suites, type)
puts
puts "# Running #{type}s:"
@@ -100,4 +102,4 @@ def status
end
end
end
-end
+end
@@ -1,7 +1,7 @@
require 'ansi'
require 'progressbar'
-module Journo
+module MiniTest
module Reporters
# Fuubar-like reporter with a progress bar.
#
@@ -10,7 +10,8 @@ module Reporters
#
# @see https://github.com/jeffkreeftmeijer/fuubar Fuubar
# @see https://gist.github.com/356945 paydro's monkey-patch
- class ProgressReporter < Journo::Reporter
+ class ProgressReporter
+ include MiniTest::Reporter
include ANSI::Code
INFO_PADDING = 2
@@ -1,14 +1,15 @@
require 'ansi'
-module Journo
+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 < Journo::Reporter
+ class SpecReporter
+ include MiniTest::Reporter
include ANSI::Code
TEST_PADDING = 2
@@ -0,0 +1,5 @@
+module MiniTest
+ module Reporters
+ VERSION = '0.2.0'
+ end
+end
@@ -1,4 +1,4 @@
-module Journo
+module MiniTest
# Runner for MiniTest suites.
#
# This is a heavily refactored version of the built-in MiniTest runner. It's
@@ -1,4 +1,4 @@
-module Journo
+module MiniTest
# Runner for individual MiniTest tests.
#
# You *should not* create instances of this class directly. Instances of
@@ -1,18 +1,18 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path('../lib', __FILE__)
-require 'journo/version'
+require 'minitest/reporters/version'
Gem::Specification.new do |s|
- s.name = 'journo'
- s.version = Journo::VERSION
+ s.name = 'minitest-reporters'
+ s.version = MiniTest::Reporters::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ['Alexander Kern']
s.email = ['alex@kernul.com']
- s.homepage = 'https://github.com/CapnKernul/journo'
- s.summary = %q{Reporters for MiniTest}
- s.description = %q{Allows you to extend MiniTest using reporters rather than monkey-patching}
+ s.homepage = 'https://github.com/CapnKernul/minitest-reporters'
+ s.summary = %q{Create customizable MiniTest output formats}
+ s.description = %q{Death to haphazard monkey-patching! Extend MiniTest through simple hooks.}
- s.rubyforge_project = 'journo'
+ s.rubyforge_project = 'minitest-reporters'
s.add_dependency 'minitest', '~> 2.0'
s.add_dependency 'ansi'
@@ -1,9 +1,13 @@
require 'test_helper'
-module JournoTest
+module MiniTestReportersTest
class ReporterTest < TestCase
def setup
- @reporter = Journo::Reporter.new
+ klass = Class.new do
+ include MiniTest::Reporter
+ end
+
+ @reporter = klass.new
end
test 'callbacks' do
@@ -1,9 +1,9 @@
require 'test_helper'
-module JournoTest
+module MiniTestReportersTest
class SuiteRunnerTest < TestCase
def setup
- @runner = Journo::SuiteRunner.new
+ @runner = MiniTest::SuiteRunner.new
@reporter = add_reporter
end
@@ -86,7 +86,7 @@ def setup
test = :test_pass
@reporter.expects(:before_test).with(suite, test)
- @reporter.expects(:pass).with(suite, test, instance_of(Journo::TestRunner))
+ @reporter.expects(:pass).with(suite, test, instance_of(MiniTest::TestRunner))
@runner._run_test(suite, test)
@@ -100,7 +100,7 @@ def setup
test = :test_skip
@reporter.expects(:before_test).with(suite, test)
- @reporter.expects(:skip).with(suite, test, instance_of(Journo::TestRunner))
+ @reporter.expects(:skip).with(suite, test, instance_of(MiniTest::TestRunner))
@runner._run_test(suite, test)
@@ -114,7 +114,7 @@ def setup
test = :test_failure
@reporter.expects(:before_test).with(suite, test)
- @reporter.expects(:failure).with(suite, test, instance_of(Journo::TestRunner))
+ @reporter.expects(:failure).with(suite, test, instance_of(MiniTest::TestRunner))
@runner._run_test(suite, test)
@@ -128,7 +128,7 @@ def setup
test = :test_error
@reporter.expects(:before_test).with(suite, test)
- @reporter.expects(:error).with(suite, test, instance_of(Journo::TestRunner))
+ @reporter.expects(:error).with(suite, test, instance_of(MiniTest::TestRunner))
@runner._run_test(suite, test)
@@ -148,7 +148,11 @@ def setup
private
def add_reporter
- reporter = Journo::Reporter.new
+ klass = Class.new do
+ include MiniTest::Reporter
+ end
+
+ reporter = klass.new
@runner.reporters << reporter
reporter
end
@@ -1,11 +1,11 @@
require 'test_helper'
-module JournoTest
+module MiniTestReportersTest
class TestRunnerTest < TestCase
def setup
@suite = stub
@test = :test_foo
- @runner = Journo::TestRunner.new(@suite, @test)
+ @runner = MiniTest::TestRunner.new(@suite, @test)
end
test '#suite' do
@@ -1,4 +1,4 @@
-module JournoTest
+module MiniTestReportersTest
module Fixtures
class EmptyTestFixture < TestCaseFixture; end
end
@@ -1,4 +1,4 @@
-module JournoTest
+module MiniTestReportersTest
module Fixtures
class ErrorTestFixture < TestCaseFixture
def test_error
@@ -1,4 +1,4 @@
-module JournoTest
+module MiniTestReportersTest
module Fixtures
class FailureTestFixture < TestCaseFixture
def test_failure
@@ -1,4 +1,4 @@
-module JournoTest
+module MiniTestReportersTest
module Fixtures
class PassTestFixture < TestCaseFixture
def test_pass
@@ -1,4 +1,4 @@
-module JournoTest
+module MiniTestReportersTest
module Fixtures
class SkipTestFixture < TestCaseFixture
def test_skip
@@ -1,4 +1,4 @@
-module JournoTest
+module MiniTestReportersTest
module Fixtures
class SuiteCallbackTestFixture < TestCaseFixture
def self.startup; end
@@ -1,4 +1,4 @@
-module JournoTest
+module MiniTestReportersTest
module Fixtures
class TestCaseFixture
attr_writer :_assertions
@@ -1,4 +1,4 @@
-module JournoTest
+module MiniTestReportersTest
class TestCase < MiniTest::Unit::TestCase
end
end
View
@@ -2,9 +2,9 @@
require 'minitest/autorun'
require 'mocha'
require 'test_declarative'
-require 'journo'
+require 'minitest/reporters'
-module JournoTest
+module MiniTestReportersTest
require File.expand_path('../support/test_case', __FILE__)
module Fixtures
@@ -18,7 +18,7 @@ module Fixtures
end
end
-MiniTest::Unit.runner = Journo::SuiteRunner.new
+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
@@ -28,6 +28,6 @@ module Fixtures
# Personally, I like the progress reporter. Make sure you don't change that line
# when you commit.
#
-# MiniTest::Unit.runner.reporters << Journo::Reporters::DefaultReporter.new
-# MiniTest::Unit.runner.reporters << Journo::Reporters::SpecReporter.new
-MiniTest::Unit.runner.reporters << Journo::Reporters::ProgressReporter.new
+# MiniTest::Unit.runner.reporters << MiniTest::Reporters::DefaultReporter.new
+# MiniTest::Unit.runner.reporters << MiniTest::Reporters::SpecReporter.new
+MiniTest::Unit.runner.reporters << MiniTest::Reporters::ProgressReporter.new

0 comments on commit e7d4988

Please sign in to comment.