Sha256: bc30e21315a3a55b8a9d795726bf084933c233939e834bd8259aef698b86773a

Contents?: true

Size: 851 Bytes

Versions: 8

Compression:

Stored size: 851 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

8 entries across 8 versions & 1 rubygems

Version Path
parallelized_specs-0.3.23 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.22 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.21 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.20 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.19 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.18 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.17 lib/parallelized_specs/example_failures_logger.rb
parallelized_specs-0.3.16 lib/parallelized_specs/example_failures_logger.rb