Sha256: c676b818428b354f7e76edc46e46e8de895653ab6f4b9a5c3273aecdf826c9ed

Contents?: true

Size: 848 Bytes

Versions: 24

Compression:

Stored size: 848 Bytes

Contents

require 'parallelized_specs'

module RSpec


  class ParallelizedSpecs::SlowestSpecLogger < ParallelizedSpecs::SpecLoggerBase

    def example_started(example)
      @spec_start_time = Time.now
    end

    def example_passed(example)
      total_time = determine_spec_duration(@spec_start_time)
      write_total_spec_time(total_time, example)
    end

    def example_failed(example, count, failure)
      total_time = determine_spec_duration(@spec_start_time)
      write_total_spec_time(total_time, example)
    end

    def determine_spec_duration(spec_start_time)
      total_time = Time.now - spec_start_time
      total_time
    end

    def write_total_spec_time(total_time, example)
      lock_output do
        @output.puts "#{total_time}*#{example.description}*#{example_group.location}"
      end
      @output.flush
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
parallelized_specs-0.4.65 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.64 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.63 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.62 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.61 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.60 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.59 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.58 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.57 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.56 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.55 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.54 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.53 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.52 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.51 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.50 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.49 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.48 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.47 lib/parallelized_specs/slow_spec_logger.rb
parallelized_specs-0.4.46 lib/parallelized_specs/slow_spec_logger.rb