Module: Guard::PHPUnit::Notifier

Defined in:
lib/guard/phpunit/notifier.rb

Overview

The Guard::PHPUnit notifier displays a notification pop-up with the tests results.

Class Method Summary collapse

Class Method Details

.notify(message, options) ⇒ Object

Displays a system notification.

Parameters:

  • message (String)

    the message to show

  • options (Hash)

    the notifier options



15
16
17
# File 'lib/guard/phpunit/notifier.rb', line 15

def notify(message, options)
  ::Guard::Notifier.notify(message, options)
end

.notify_results(test_results) ⇒ Object

Displays a notification about the tests results.

Parameters:

  • test_results (Hash)

    the parsed tests results

Options Hash (test_results):

  • :tests (Integer)

    tests count

  • :failures (Integer)

    failures count

  • :errors (Integer)

    count count

  • :pending (Integer)

    pending tests count

  • :duration (Integer)

    tests duration



28
29
30
31
32
33
# File 'lib/guard/phpunit/notifier.rb', line 28

def notify_results(test_results)
  notify(message(test_results), {
    :title => 'PHPUnit results',
    :image => image(test_results)
  })
end