Sha256: 6ceb450e1d872d333f68f797a30b57999dfd6fbaab51c3061bf070b6b28b4749
Contents?: true
Size: 846 Bytes
Versions: 3
Compression:
Stored size: 846 Bytes
Contents
require 'parallelized_specs' module RSpec class ParallelizedSpecs::SlowestSpecLogger < ParallelizedSpecs::SpecLoggerBase def initialize(*args) @example_times = [] 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/slowest_specs.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
3 entries across 3 versions & 1 rubygems