Module: Guard::PHPUnit::Formatter

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

Overview

The Guard::PHPUnit formatter parses the output of phpunit which gets printed by the progress printer.

Class Method Summary collapse

Class Method Details

.parse_output(text) ⇒ Hash

Parses the tests output.

Parameters:

  • text (String)

    the output of phpunit.

Returns:

  • (Hash)

    the parsed results



16
17
18
19
20
21
22
23
24
25
# File 'lib/guard/phpunit/formatter.rb', line 16

def parse_output(text)
  results = {
    :tests    => look_for_words_in('test',    text),
    :failures => look_for_words_in('failure', text),
    :errors   => look_for_words_in('error', text),
    :pending  => look_for_words_in(['skipped', 'incomplete'], text),
    :duration => look_for_duration_in(text)
  }
  results.freeze
end