Sha256: 038eb8981c76d89ab165b4620335cd3c47b5b15ed92c69a5fca3f5cbce65a908
Contents?: true
Size: 855 Bytes
Versions: 1
Compression:
Stored size: 855 Bytes
Contents
require 'parallelized_specs' module RSpec class ParallelizedSpecs::SlowestSpecLogger < ParallelizedSpecs::SpecLoggerBase def initialize(*args) @example_times = [] super end def example_started(example) @spec_start_time = Time.now end def example_passed(example) add_total_spec_time(example) end def example_failed(example, count, failure) add_total_spec_time(example) end def dump_summary(*args) File.open("#{Rails.root}/tmp/parallel_log/spec_times.log", 'a+') do |f| @example_times.each { |example_details| f.puts "#{example_details}" } end end def add_total_spec_time(example) total_time = Time.now - @spec_start_time @example_times << "#{total_time}*#{example.description}*#{example_group.location.match(/.*rb/).to_s}" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
parallelized_specs-0.4.77 | lib/parallelized_specs/slow_spec_logger.rb |