Class: TurboTests::DocumentationFormatter

Inherits:
BaseFormatter
  • Object
show all
Defined in:
lib/turbo_tests/documentation_formatter.rb

Overview

An RSpec formatter that prepends the process id to all messages

Instance Method Summary collapse

Methods inherited from BaseFormatter

#dump_summary

Instance Method Details

#example_failed(notification) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/turbo_tests/documentation_formatter.rb', line 28

def example_failed(notification)
  output.puts RSpec::Core::Formatters::ConsoleCodes.wrap(
                "#{output_example(notification.example)} (FAILED - #{next_failure_index})",
                :failure,
              )

  output.flush
end

#example_passed(notification) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/turbo_tests/documentation_formatter.rb', line 8

def example_passed(notification)
  output.puts RSpec::Core::Formatters::ConsoleCodes.wrap(
                output_example(notification.example),
                :success,
              )

  output.flush
end

#example_pending(notification) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/turbo_tests/documentation_formatter.rb', line 17

def example_pending(notification)
  message = notification.example.execution_result.pending_message

  output.puts RSpec::Core::Formatters::ConsoleCodes.wrap(
                "#{output_example(notification.example)} (PENDING: #{message})",
                :pending,
              )

  output.flush
end