Class: ParallelTests::RSpec::FailuresLogger

Inherits:
LoggerBase
  • Object
show all
Defined in:
lib/parallel_tests/rspec/failures_logger.rb

Constant Summary

Constants inherited from LoggerBase

LoggerBase::RSPEC_1

Instance Method Summary collapse

Methods inherited from LoggerBase

#close, #initialize, #lock_output

Constructor Details

This class inherits a constructor from ParallelTests::RSpec::LoggerBase

Instance Method Details

#dump_failure(*args) ⇒ Object

RSpec 1: dumps 1 failed spec



16
17
# File 'lib/parallel_tests/rspec/failures_logger.rb', line 16

def dump_failure(*args)
end

#dump_failures(*args) ⇒ Object

RSpec 2: dumps all failed specs



20
21
# File 'lib/parallel_tests/rspec/failures_logger.rb', line 20

def dump_failures(*args)
end

#dump_summary(*args) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/parallel_tests/rspec/failures_logger.rb', line 23

def dump_summary(*args)
  lock_output do
    if RSPEC_1
      dump_commands_to_rerun_failed_examples_rspec_1
    else
      dump_commands_to_rerun_failed_examples
    end
  end
  @output.flush
end

#example_failed(example, *args) ⇒ Object

RSpec 1: does not keep track of failures, so we do



6
7
8
9
10
11
12
13
# File 'lib/parallel_tests/rspec/failures_logger.rb', line 6

def example_failed(example, *args)
  if RSPEC_1
    @failed_examples ||= []
    @failed_examples << example
  else
    super
  end
end