Class: Mutant::Reporter::CLI Private

Inherits:
Mutant::Reporter show all
Defined in:
lib/mutant/reporter/cli.rb,
lib/mutant/reporter/cli/format.rb,
lib/mutant/reporter/cli/printer.rb,
lib/mutant/reporter/cli/printer/env.rb,
lib/mutant/reporter/cli/printer/test.rb,
lib/mutant/reporter/cli/printer/config.rb,
lib/mutant/reporter/cli/printer/mutation.rb,
lib/mutant/reporter/cli/printer/env_result.rb,
lib/mutant/reporter/cli/printer/env_progress.rb,
lib/mutant/reporter/cli/printer/subject_result.rb,
lib/mutant/reporter/cli/printer/coverage_result.rb,
lib/mutant/reporter/cli/printer/mutation_result.rb,
lib/mutant/reporter/cli/printer/isolation_result.rb,
lib/mutant/reporter/cli/printer/status_progressive.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Reporter that reports in human readable format

Defined Under Namespace

Classes: Format, Printer

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(output) ⇒ Reporter::CLI

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Build reporter

Parameters:

  • output (IO)

Returns:



14
15
16
17
18
19
20
# File 'lib/mutant/reporter/cli.rb', line 14

def self.build(output)
  new(
    format:         Format::Progressive.new(tty: output.respond_to?(:tty?) && output.tty?),
    print_warnings: false,
    output:
  )
end

Instance Method Details

#delayFloat

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Report delay in seconds

Returns:

  • (Float)


63
64
65
# File 'lib/mutant/reporter/cli.rb', line 63

def delay
  format.delay
end

#progress(status) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Report progress object

Parameters:

Returns:

  • (self)


47
48
49
50
# File 'lib/mutant/reporter/cli.rb', line 47

def progress(status)
  write(format.progress(status))
  self
end

#report(env) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Report env

Parameters:

Returns:

  • (self)


82
83
84
85
# File 'lib/mutant/reporter/cli.rb', line 82

def report(env)
  Printer::EnvResult.call(output:, object: env)
  self
end

#start(env) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Report start

Parameters:

Returns:

  • (self)


27
28
29
30
# File 'lib/mutant/reporter/cli.rb', line 27

def start(env)
  write(format.start(env))
  self
end

#test_progress(status) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Report progress object

Returns:

  • (self)


55
56
57
58
# File 'lib/mutant/reporter/cli.rb', line 55

def test_progress(status)
  write(format.test_progress(status))
  self
end

#test_report(env) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Report env

Parameters:

Returns:

  • (self)


92
93
94
95
# File 'lib/mutant/reporter/cli.rb', line 92

def test_report(env)
  Printer::Test::EnvResult.call(output:, object: env)
  self
end

#test_start(env) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Report test start

Parameters:

Returns:

  • (self)


37
38
39
40
# File 'lib/mutant/reporter/cli.rb', line 37

def test_start(env)
  write(format.test_start(env))
  self
end

#warn(message) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Report warning

Parameters:

  • message (String)

Returns:

  • (self)


72
73
74
75
# File 'lib/mutant/reporter/cli.rb', line 72

def warn(message)
  output.puts(message) if print_warnings
  self
end