Skip to content
Browse files

new reporter for guard-minitest users

  • Loading branch information...
1 parent f27286c commit 901ba8497b969c81727c1a5d0a60acb5ae443018 @bramswenson bramswenson committed
Showing with 25 additions and 1 deletion.
  1. +2 −1 README.md
  2. +1 −0 lib/minitest/reporters.rb
  3. +22 −0 lib/minitest/reporters/guard_reporter.rb
View
3 README.md
@@ -26,6 +26,7 @@ The following reporters are provided:
MiniTest::Reporters::ProgressReporter # => Fuubar-like output with a progress bar
MiniTest::Reporters::RubyMateReporter # => Simple reporter designed for RubyMate
MiniTest::Reporters::RubyMineReporter # => Reporter designed for RubyMine IDE and TeamCity CI server; see below
+ MiniTest::Reporters::GuardReporter # => Integrates with guard-minitest to provide on-screen notifications
I really like `ProgressReporter` for my everyday terminal usage, but I like
using `RubyMateReporter` when I'm executing test suites from TextMate. My usual
@@ -67,4 +68,4 @@ If you prefer integration with RubyMine test runner or TeamCity CI server you'll
## License ##
-Minitest-reporters is licensed under the MIT License. See `LICENSE` for details.
+Minitest-reporters is licensed under the MIT License. See `LICENSE` for details.
View
1 lib/minitest/reporters.rb
@@ -14,5 +14,6 @@ module Reporters
autoload :ProgressReporter, "minitest/reporters/progress_reporter"
autoload :RubyMateReporter, "minitest/reporters/ruby_mate_reporter"
autoload :RubyMineReporter, "minitest/reporters/rubymine_reporter"
+ autoload :GuardReporter, "minitest/reporters/guard_reporter"
end
end
View
22 lib/minitest/reporters/guard_reporter.rb
@@ -0,0 +1,22 @@
+begin
+ require 'guard/minitest/notifier'
+rescue LoadError
+ puts "You need guard-minitest to use this reporter"
+ exit 1
+end
+
+module MiniTest
+ module Reporters
+
+ class GuardReporter
+ include MiniTest::Reporter
+
+ def after_suites(*args)
+ duration = Time.now - runner.start_time
+ ::Guard::MinitestNotifier.notify(runner.test_count, runner.assertion_count,
+ runner.failures, runner.errors,
+ runner.skips, duration)
+ end
+ end
+ end
+end

0 comments on commit 901ba84

Please sign in to comment.
Something went wrong with that request. Please try again.