lib/autotest_notification.rb in urubatan-autotest-notification-0.2.0 vs lib/autotest_notification.rb in urubatan-autotest-notification-1.0.1
- old
+ new
@@ -41,26 +41,26 @@
code = (failures > 0) ? 31 : (pendings > 0) ? 33 : 32
"#{pluralize('example', examples)}, #{pluralize('failure', failures)}, #{pendings} pending"
end
if failures > 0 || errors > 0
- notify "FAIL", msg, FAIL_IMAGE, 2
+ notify "FAIL", msg, FAIL_IMAGE, failures, 2
else
- notify "Pass", msg, SUCCESS_IMAGE
+ notify "Pass", msg, SUCCESS_IMAGE, failures
end
puts "\e[#{code}m#{'=' * 80}\e[0m\n\n"
end
end
class << self
- def notify(title, msg, img = SUCCESS_IMAGE, pri = 0)
+ def notify(title, msg, img = SUCCESS_IMAGE, failures = 0, pri = 0)
case RUBY_PLATFORM
when /linux/
Linux.notify(title, msg, img)
when /darwin/
- Mac.notify(title, msg, img, pri)
+ Mac.notify(title, msg, img, failures, pri)
when /cygwin/
Cygwin.notify(title, msg, img)
when /mswin/
Windows.notify(title, msg, img)
end
@@ -69,5 +69,6 @@
def pluralize(text, number)
"#{number} #{text}#{'s' if number != 1}"
end
end
end
+