class Rails::TestUnitReporter

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/rails/test_unit/reporter.rbs

class Rails::TestUnitReporter < Rails::Minitest::StatisticsReporter
  def color_output: (String string, by: Minitest::Result) -> String
  def colored_output?: () -> true
  def fail_fast?: () -> nil
  def format_rerun_snippet: (Minitest::Result result) -> String
  def output_inline?: () -> true
  def record: (Minitest::Result result) -> nil
  def relative_path_for: (String file) -> String
  def report: () -> nil
end

def aggregated_results # :nodoc:

:nodoc:
def aggregated_results # :nodoc:
  filtered_results.map { |result| format_rerun_snippet(result) }.join "\n"
end

def app_root

def app_root
  @app_root ||= self.class.app_root ||
    if defined?(ENGINE_ROOT)
      ENGINE_ROOT
    elsif Rails.respond_to?(:root)
      Rails.root
    end
end

def color_output(string, by:)

Experimental RBS support (using type sampling data from the type_fusion project).

def color_output: (String string, by: Minitest::Result) -> String

This signature was generated using 7 samples from 1 application.

def color_output(string, by:)
  if colored_output?
    "\e[#{COLOR_BY_RESULT_CODE[by.result_code]}m#{string}\e[0m"
  else
    string
  end
end

def colored_output?

Experimental RBS support (using type sampling data from the type_fusion project).

def colored_output?: () -> true

This signature was generated using 13 samples from 1 application.

def colored_output?
  options[:color] && io.respond_to?(:tty?) && io.tty?
end

def fail_fast?

Experimental RBS support (using type sampling data from the type_fusion project).

def fail_fast?: () -> nil

This signature was generated using 11 samples from 1 application.

def fail_fast?
  options[:fail_fast]
end

def filtered_results

def filtered_results
  if options[:verbose]
    results
  else
    results.reject(&:skipped?)
  end
end

def format_line(result)

def format_line(result)
  klass = result.respond_to?(:klass) ? result.klass : result.class
  "%s#%s = %.2f s = %s" % [klass, result.name, result.time, result.result_code]
end

def format_rerun_snippet(result)

Experimental RBS support (using type sampling data from the type_fusion project).

def format_rerun_snippet: (Minitest::Result result) -> String

This signature was generated using 1 sample from 1 application.

def format_rerun_snippet(result)
  location, line = if result.respond_to?(:source_location)
    result.source_location
  else
    result.method(result.name).source_location
  end
  "#{executable} #{relative_path_for(location)}:#{line}"
end

def output_inline?

Experimental RBS support (using type sampling data from the type_fusion project).

def output_inline?: () -> true

This signature was generated using 7 samples from 1 application.

def output_inline?
  options[:output_inline]
end

def record(result)

Experimental RBS support (using type sampling data from the type_fusion project).

def record: (Minitest::Result result) -> nil

This signature was generated using 8 samples from 1 application.

def record(result)
  super
  if options[:verbose]
    io.puts color_output(format_line(result), by: result)
  else
    io.print color_output(result.result_code, by: result)
  end
  if output_inline? && result.failure && (!result.skipped? || options[:verbose])
    io.puts
    io.puts
    io.puts color_output(result, by: result)
    io.puts
    io.puts format_rerun_snippet(result)
    io.puts
  end
  if fail_fast? && result.failure && !result.skipped?
    raise Interrupt
  end
end

def relative_path_for(file)

Experimental RBS support (using type sampling data from the type_fusion project).

def relative_path_for: (String file) -> String

This signature was generated using 1 sample from 1 application.

def relative_path_for(file)
  file.sub(/^#{app_root}\/?/, "")
end

def report

Experimental RBS support (using type sampling data from the type_fusion project).

def report: () -> nil

This signature was generated using 2 samples from 1 application.

def report
  return if output_inline? || filtered_results.empty?
  io.puts
  io.puts "Failed tests:"
  io.puts
  io.puts aggregated_results
end