Module: TestNotifier
- Extended by:
- TestNotifier
- Included in:
- TestNotifier
- Defined in:
- lib/test_notifier.rb,
lib/test_notifier/stats.rb,
lib/test_notifier/runner.rb,
lib/test_notifier/version.rb
Defined Under Namespace
Modules: Runner, Version
Classes: Stats
Constant Summary
collapse
- NO_NOTIFIERS_MESSAGE =
"[TEST NOTIFIER] You have no supported notifiers installed. Please read documentation.\n"
- 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!"
}
- COLORS =
{
:fail => "orange",
:success => "green",
:error => "red"
}
Class Attribute Summary collapse
Instance Method Summary
collapse
Class Attribute Details
.silence_no_notifier_warning ⇒ Object
Returns the value of attribute silence_no_notifier_warning.
5
6
7
|
# File 'lib/test_notifier.rb', line 5
def silence_no_notifier_warning
@silence_no_notifier_warning
end
|
Instance Method Details
#default_notifier=(notifier) ⇒ Object
30
31
32
|
# File 'lib/test_notifier.rb', line 30
def default_notifier=(notifier)
Notifier.default_notifier = notifier
end
|
#notifier ⇒ Object
44
45
46
47
48
49
50
51
52
|
# File 'lib/test_notifier.rb', line 44
def notifier
notifier = Notifier.notifier
if notifier == Notifier::Placebo && !silence_no_notifier_warning
STDERR << NO_NOTIFIERS_MESSAGE
end
notifier
end
|
#notify(options) ⇒ Object
34
35
36
37
38
39
40
41
42
|
# File 'lib/test_notifier.rb', line 34
def notify(options)
options.merge!({
:title => TITLES[options[:status]],
:image => IMAGES[options[:status]],
:color => COLORS[options[:status]]
})
notifier.notify(options)
end
|