Class: Testrus::Tester::Formatter::Default

Inherits:
Object
  • Object
show all
Defined in:
lib/testrus/tester/formatter/default.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(run) ⇒ Default

Public: The formatter is responsible for reporting the run data to the user. New formatters can easily be added here. The layout of this formatter should be used for guidance on how to create new formatters. Also see the documentation for Run and the sources to find what information is available to the formatter.

The formatter does not return anything useful, it is simply used to report to the user. The default formatter simply reports to STDOUT.

run - The Run containing the run data (memory usage, output, cpu time,

etc.)


21
22
23
# File 'lib/testrus/tester/formatter/default.rb', line 21

def initialize(run)
  @run = run
end

Instance Attribute Details

#runObject (readonly)

Returns the value of attribute run.



7
8
9
# File 'lib/testrus/tester/formatter/default.rb', line 7

def run
  @run
end

Instance Method Details

#reportObject

Public: Creates the actual report.



26
27
28
# File 'lib/testrus/tester/formatter/default.rb', line 26

def report
  run.passed? && run.within_constraints? ? report_success : report_failure
end