File: failures_logger.rb

package info (click to toggle)
ruby-parallel-tests 5.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 760 kB
  • sloc: ruby: 5,446; javascript: 16; makefile: 4
file content (18 lines) | stat: -rw-r--r-- 548 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true
require 'parallel_tests/rspec/logger_base'
require 'parallel_tests/rspec/runner'

class ParallelTests::RSpec::FailuresLogger < ParallelTests::RSpec::LoggerBase
  RSpec::Core::Formatters.register(self, :dump_summary)

  def dump_summary(*args)
    lock_output do
      notification = args.first
      unless notification.failed_examples.empty?
        colorizer = ::RSpec::Core::Formatters::ConsoleCodes
        output.puts notification.colorized_rerun_commands(colorizer)
      end
    end
    @output.flush
  end
end