Sha256: d89ce58dba74b4e9747b696fe15ed8e857ce4d495448e12547cd91f91eadf5f0

Contents?: true

Size: 858 Bytes

Versions: 7

Compression:

Stored size: 858 Bytes

Contents

require 'parallelized_specs/spec_logger_base'

class ParallelizedSpecs::ExampleRerunFailuresLogger < ParallelizedSpecs::SpecLoggerBase

  def example_failed(example, *args)
    if RSPEC_1
      if example.location != nil
        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.chomp} "
        end
      end
      else
      super
    end
  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.chomp} "
      end
    end
    @output.flush
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
parallelized_specs-0.3.13 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.09 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.08 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.07 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.06 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.05 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.04 lib/parallelized_specs/example_failures_logger.rb