Notifier for testing framework riot.

Notifies you about passes, errors, failures via custom notify libraries like libnotify.

Usage

# in your test/helper.rb

require 'riot'
require 'riot_notifier'

# Auto-detect in load order
Riot.reporter = RiotNotifier

Advanced usage

require 'riot'
require 'riot_notifier'

# Auto-detect in specified order notifier defined in RiotNotifier
Riot.reporter = RiotNotifier.try(:Libnotify, :RedgreenBinary)
Riot.reporter = RiotNotifier[:Libnotify, :RedgreenBinary] # sugar

# Use specific notifier class (libnotify)
Riot.reporter = RiotNotifier::Libnotify

# Use my own notifier
class MyOwn < ::RiotNotifier::Base
  # override .notify and #usable?
end

Riot.reporter = RiotNotifier[MyOwn] # try only this
Riot.reporter = RiotNotifier # try MyOwn first (auto-detection)

# Use my own inline
Riot.reporter = Class.new(RiotNotifier::Base) do
  def notify(color, msg)
    MyFancyNotifierGem.notify(:color => color, :message => msg)
  end

  def self.usable?
    require 'my_fancy_notifier_gem'
    true
  rescue LoadError
    false
  end
end

Installation

gem install riot_notifier

Testing

git co git://github.com/splattael/riot_notifier.git
cd riot_notifier
gem install bundler
bundle install
rake

Authors

  • Peter Suschlik

TODO

  • Test Libnotify