Class: RuboCop::RSpec::ParallelFormatter

Inherits:
RSpec::Core::Formatters::BaseTextFormatter
  • Object
show all
Defined in:
lib/rubocop/rspec/parallel_formatter.rb

Overview

RSpec formatter for use with running ‘rake spec` in parallel. This formatter removes much of the noise from RSpec so that only the important information will be surfaced by test-queue. It also adds metadata to the output in order to more easily find the text needed for outputting after the parallel run completes.

Instance Method Summary collapse

Instance Method Details

#dump_failures(notification) ⇒ Object

The BEGIN/END comments are used by ‘spec_runner.rake` to determine what output goes where in the final parallelized output, and should not be removed!



22
23
24
25
26
27
28
29
30
31
# File 'lib/rubocop/rspec/parallel_formatter.rb', line 22

def dump_failures(notification)
  return if notification.failure_notifications.empty?

  output.puts '# FAILURES BEGIN'
  notification.failure_notifications.each do |failure|
    output.puts failure.fully_formatted('*', colorizer)
  end
  output.puts
  output.puts '# FAILURES END'
end

#dump_pendingObject

Don’t show pending tests



17
# File 'lib/rubocop/rspec/parallel_formatter.rb', line 17

def dump_pending(*); end

#dump_summary(summary) ⇒ Object



33
34
35
36
# File 'lib/rubocop/rspec/parallel_formatter.rb', line 33

def dump_summary(summary)
  output_summary(summary)
  output_rerun_commands(summary)
end