Class: ShoulderTap::Notification
- Inherits:
-
Object
- Object
- ShoulderTap::Notification
- Defined in:
- lib/shouldertap/notification.rb
Constant Summary collapse
- SUCCESS_ICON =
"dialog-information.png"- FAILURE_ICON =
"dialog-error.png"- DEFAULT_SENDER =
'ShoulderTap'
Instance Method Summary collapse
- #icon ⇒ Object
-
#initialize(testsuite, sender = nil) ⇒ Notification
constructor
A new instance of Notification.
- #message ⇒ Object
- #send ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(testsuite, sender = nil) ⇒ Notification
Returns a new instance of Notification.
10 11 12 13 |
# File 'lib/shouldertap/notification.rb', line 10 def initialize(testsuite, sender = nil) @testsuite = testsuite @sender = sender.nil? ? DEFAULT_SENDER : sender end |
Instance Method Details
#icon ⇒ Object
27 28 29 |
# File 'lib/shouldertap/notification.rb', line 27 def icon resources + (@testsuite.success? ? SUCCESS_ICON : FAILURE_ICON) end |
#message ⇒ Object
23 24 25 |
# File 'lib/shouldertap/notification.rb', line 23 def success_ratio + ' tests passed' end |
#send ⇒ Object
15 16 17 |
# File 'lib/shouldertap/notification.rb', line 15 def send Notify.notify title, , :app_name => 'ShoulderTap', :icon => icon end |
#title ⇒ Object
19 20 21 |
# File 'lib/shouldertap/notification.rb', line 19 def title @sender + " - " + (@testsuite.success? ? "Passed" : "Failed") end |