Sha256: 3743a121f6cd5dcded01b0d17afb614f190a10355750d3a581b5f520e0e4300f

Contents?: true

Size: 1.25 KB

Versions: 126

Compression:

Stored size: 1.25 KB

Contents

require 'parallelized_specs'
require File.join(File.dirname(__FILE__), 'spec_logger_base')

class ParallelizedSpecs::SpecErrorLogger < ParallelizedSpecs::SpecLoggerBase
  def initialize(options, output=nil)
    super
    @passed_examples = []
    @pending_examples = []
    @failed_examples = []
  end

  def example_passed(example)
    @passed_examples << example
  end

  def example_pending(*args)
    @pending_examples << args
  end

  def example_failed(example, count, failure)
    @failed_examples << failure
  end

  def dump_summary(duration, example_count, failure_count, pending_count)
    lock_output do
      env_test_number = ENV['TEST_ENV_NUMBER']
      env_test_number = 1 if ENV['TEST_ENV_NUMBER'].blank?
      @output.puts ""
      @output.puts ""
      @output.puts "FOR TEST EXECUTOR #{env_test_number}: #{@failed_examples.size} failed, #{@passed_examples.size} passed:"
      @failed_examples.each.with_index do |failure, i|
        @output.puts ""
        @output.puts "#{ i + 1 })"
        @output.puts failure.header
        unless failure.exception.nil?
          @output.puts failure.exception.to_s
          failure.exception.backtrace.each do |caller|
            @output.puts caller
          end
        end
      end
    end
    @output.flush
  end
end

Version data entries

126 entries across 126 versions & 1 rubygems

Version Path
parallelized_specs-0.4.84 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.83 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.82 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.81 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.80 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.79 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.78 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.77 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.76 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.75 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.74 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.73 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.72 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.71 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.70 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.69 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.68 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.67 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.66 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.4.65 lib/parallelized_specs/spec_error_logger.rb