Sha256: 467a147a59ef9c72df2c5a6b6dc250cb39a74e724e88341c8b61b7721c6fa601

Contents?: true

Size: 1.26 KB

Versions: 87

Compression:

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

87 entries across 87 versions & 1 rubygems

Version Path
parallelized_specs-0.3.57 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.56 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.55 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.54 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.53 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.51 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.50 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.49 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.48 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.47 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.46 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.45 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.44 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.43 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.42 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.41 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.40 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.39 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.38 lib/parallelized_specs/spec_error_logger.rb
parallelized_specs-0.3.37 lib/parallelized_specs/spec_error_logger.rb