Class: ParallelSpecs::SpecFailuresLogger

Inherits:
SpecLoggerBase show all
Defined in:
lib/parallel_specs/spec_failures_logger.rb

Constant Summary

Constants inherited from SpecLoggerBase

ParallelSpecs::SpecLoggerBase::RSPEC_1

Instance Method Summary collapse

Methods inherited from SpecLoggerBase

#close, #dump_pending, #initialize, #lock_output

Constructor Details

This class inherits a constructor from ParallelSpecs::SpecLoggerBase

Instance Method Details

#dump_failure(*args) ⇒ Object

RSpec 1: dumps 1 failed spec



15
16
# File 'lib/parallel_specs/spec_failures_logger.rb', line 15

def dump_failure(*args)
end

#dump_failures(*args) ⇒ Object

RSpec 2: dumps all failed specs



19
20
# File 'lib/parallel_specs/spec_failures_logger.rb', line 19

def dump_failures(*args)
end

#dump_summary(*args) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/parallel_specs/spec_failures_logger.rb', line 22

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



5
6
7
8
9
10
11
12
# File 'lib/parallel_specs/spec_failures_logger.rb', line 5

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