Sha256: 5afe6da01573f28047a93a8704356f0e51a7d1832e8b08ab87ee814e263f9fca
Contents?: true
Size: 1.2 KB
Versions: 4
Compression:
Stored size: 1.2 KB
Contents
module TestNotifier class << self attr_accessor :__notifier__ attr_accessor :default_notifier end extend self class UnsupportedNotifierError < StandardError; end IMAGES = { :fail => File.dirname(__FILE__) + "/../resources/fail.png", :error => File.dirname(__FILE__) + "/../resources/error.png", :success => File.dirname(__FILE__) + "/../resources/success.png" } TITLES = { :fail => "Failed!", :success => "Passed!", :error => "Error!" } def notify(options) options.merge!({ :title => TITLES[options[:status]], :image => IMAGES[options[:status]] }) notifier.notify(options) end def notifier self.__notifier__ ||= begin notifier = nil notifier = TestNotifier::Notifier.supported_notifier_from_name(default_notifier) if default_notifier notifier = TestNotifier::Notifier.supported_notifiers.first unless notifier raise UnsupportedNotifierError, "You have no supported notifiers installed. Please read documentation." unless notifier notifier end end autoload :Notifier, "test_notifier/notifier" autoload :Runner, "test_notifier/runner" autoload :Stats, "test_notifier/stats" end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
test_notifier-0.3.4 | lib/test_notifier.rb |
test_notifier-0.3.3 | lib/test_notifier.rb |
test_notifier-0.3.2 | lib/test_notifier.rb |
test_notifier-0.3.1 | lib/test_notifier.rb |