Sha256: b8e3a48fbf78116f3f0dbe7ec4cf54744e3c9fac9aadcc22e788733c562c6bf9

Contents?: true

Size: 852 Bytes

Versions: 5

Compression:

Stored size: 852 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.write "#{@failed_examples.to_s}"
      end
    end
    @output.flush
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
parallelized_specs-0.3.28 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.27 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.26 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.25 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.24 lib/parallelized_specs/example_failures_logger.rb