Sha256: 6983cbc34218da499142adedba2108bfe662299b83d0ec8d050a04c2691d2d24

Contents?: true

Size: 788 Bytes

Versions: 2

Compression:

Stored size: 788 Bytes

Contents

require 'parallelized_specs/spec_logger_base'

class ParallelizedSpecs::ExampleRerunFailuresLogger < ParallelizedSpecs::SpecLoggerBase

  def example_failed(example, *args)
    if RSPEC_1
      unless !!self.example_group.nested_descriptions.to_s.match(/shared/) || !!self.instance_variable_get(:@example_group).examples.last.location.match(/helper/)
        @failed_examples ||= []
        @failed_examples << "#{example.location.match(/spec.*\d/).to_s} "
      end
    end
  else
    super
  end

# RSpec 1: dumps 1 failed spec
  def dump_failure(*args)
  end

# RSpec 2: dumps all failed specs
  def dump_failures(*args)
  end

  def dump_summary(*args)
    lock_output do
      if RSPEC_1
        @output.puts "#{@failed_examples.to_s}"
      end
    end
    @output.flush
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
parallelized_specs-0.2.1 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.2.0 lib/parallelized_specs/example_failures_logger.rb