Class: Henitai::Reporter::Terminal

Inherits:
Base
  • Object
show all
Includes:
UnparseHelper
Defined in:
lib/henitai/reporter.rb

Overview

Terminal reporter.

Constant Summary collapse

PROGRESS_GLYPHS =
{
  killed: "ยท",
  survived: "S",
  timeout: "T",
  ignored: "I"
}.freeze

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Henitai::Reporter::Base

Instance Method Details

#progress(mutant, scenario_result: nil) ⇒ Object



68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/henitai/reporter.rb', line 68

def progress(mutant, scenario_result: nil)
  glyph = PROGRESS_GLYPHS[mutant.status]
  return unless glyph

  print(glyph)
  return flush unless should_show_logs?(scenario_result)

  output = scenario_output(scenario_result)
  print("\n")
  print("log: #{scenario_result.log_path}\n")
  print(output) unless output.empty?
  $stdout.flush
end

#report(result) ⇒ Object



64
65
66
# File 'lib/henitai/reporter.rb', line 64

def report(result)
  puts report_lines(result)
end