Class: MinitestReportersGithub

Inherits:
Minitest::Reporters::BaseReporter
  • Object
show all
Defined in:
lib/minitest_reporters_github.rb

Overview

Simple reporter designed for Github Actions

Constant Summary collapse

ESCAPE_MAP =
{ '%' => '%25', "\n" => '%0A', "\r" => '%0D' }.freeze

Instance Method Summary collapse

Instance Method Details

#message_for(test) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/minitest_reporters_github.rb', line 26

def message_for(test)
  if test.passed? || test.skipped?
    nil
  elsif test.failure
    to_annotation(test, "Failure")
  elsif test.error?
    to_annotation(test, "Error")
  end
end

#record(test) ⇒ Object



20
21
22
23
24
# File 'lib/minitest_reporters_github.rb', line 20

def record(test)
  super

  print(message_for(test))
end

#startObject



14
15
16
17
18
# File 'lib/minitest_reporters_github.rb', line 14

def start
  super

  print_run_options
end