Skip to content

Commit

Permalink
Merge pull request #12 from bramswenson/guard_reporter
Browse files Browse the repository at this point in the history
new reporter for guard-minitest users
  • Loading branch information
Alexander Kern committed Apr 6, 2012
2 parents f27286c + 901ba84 commit d9a3c7c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
1 change: 1 addition & 0 deletions lib/minitest/reporters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 22 additions & 0 deletions lib/minitest/reporters/guard_reporter.rb
Original file line number Diff line number Diff line change
@@ -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 d9a3c7c

Please sign in to comment.