Class: RSpec::ParallelFormatter

Inherits:
Core::Formatters::BaseTextFormatter
  • Object
show all
Defined in:
lib/parallel_formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ ParallelFormatter

Returns a new instance of ParallelFormatter.



10
11
12
13
# File 'lib/parallel_formatter.rb', line 10

def initialize(output)
  super
  @failed_examples = []
end

Instance Method Details

#example_failed(failure) ⇒ Object



33
34
35
36
37
38
# File 'lib/parallel_formatter.rb', line 33

def example_failed(failure)
  @failed_examples << failure.example
  output.puts failure_output(failure.example,
                             failure.example.execution_result.exception)
  output.puts failure.fully_formatted(@failed_examples.size)
end

#example_group_started(notification) ⇒ Object



15
16
17
# File 'lib/parallel_formatter.rb', line 15

def example_group_started(notification)
  output.puts "GROUP STARTED: #{notification.group.description.strip}"
end

#example_passed(passed) ⇒ Object



24
25
26
# File 'lib/parallel_formatter.rb', line 24

def example_passed(passed)
  output.puts passed_output(passed.example)
end

#example_pending(pending) ⇒ Object



28
29
30
31
# File 'lib/parallel_formatter.rb', line 28

def example_pending(pending)
  output.puts pending_output(pending.example,
                             pending.example.execution_result.pending_message)
end

#example_started(notification) ⇒ Object



19
20
21
22
# File 'lib/parallel_formatter.rb', line 19

def example_started(notification)
  output.puts "TEST STARTED: #{notification.example.location}: " \
              "#{notification.example.description}"
end