Class: Guard::SporkMinitestNotifier
- Inherits:
-
Object
- Object
- Guard::SporkMinitestNotifier
- Defined in:
- lib/guard/sporkminitest/notifier.rb
Class Method Summary collapse
-
.guard_image(failure_count, skip_count) ⇒ Object
failed | pending (skip) | success.
- .guard_message(test_count, assertion_count, failure_count, error_count, skip_count, duration) ⇒ Object
- .notify(test_count, assertion_count, failure_count, error_count, skip_count, duration) ⇒ Object
Class Method Details
.guard_image(failure_count, skip_count) ⇒ Object
failed | pending (skip) | success
20 21 22 23 24 25 26 27 28 |
# File 'lib/guard/sporkminitest/notifier.rb', line 20 def self.guard_image(failure_count, skip_count) icon = if failure_count > 0 :failed elsif skip_count > 0 :pending else :success end end |
.guard_message(test_count, assertion_count, failure_count, error_count, skip_count, duration) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/guard/sporkminitest/notifier.rb', line 7 def self.(test_count, assertion_count, failure_count, error_count, skip_count, duration) # TODO: use a dang Hash = "#{test_count} examples, #{assertion_count} assertions, #{failure_count} failures, #{error_count} errors" if skip_count > 0 << " (#{skip_count} skips)" end if test_count && assertion_count << "\nin %.6f seconds, %.4f tests/s, %.4f assertions/s." % [duration, test_count / duration, assertion_count / duration] end end |
.notify(test_count, assertion_count, failure_count, error_count, skip_count, duration) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/guard/sporkminitest/notifier.rb', line 30 def self.notify(test_count, assertion_count, failure_count, error_count, skip_count, duration) = (test_count, assertion_count, failure_count, error_count, skip_count, duration) image = guard_image(failure_count + error_count, skip_count) ::Guard::Notifier.notify(, :title => 'MiniTest results', :image => image) end |