Class: CIAT::Feedback::StandardOutput
- Inherits:
-
Object
- Object
- CIAT::Feedback::StandardOutput
- Defined in:
- lib/ciat/feedback/standard_output.rb
Overview
This feedback class sends some simple messages to the screen about the progress of a CIAT::Suite run.
Constant Summary collapse
- LIGHT_OUTPUTS =
{ CIAT::TrafficLight::GREEN => ".", CIAT::TrafficLight::RED => "F", CIAT::TrafficLight::YELLOW => "E", CIAT::TrafficLight::UNSET => "-", CIAT::TrafficLight::UNNEEDED => "." }
Instance Method Summary collapse
-
#initialize(counter) ⇒ StandardOutput
constructor
A new instance of StandardOutput.
- #post_tests(suite) ⇒ Object
- #pre_tests(suite) ⇒ Object
- #report_subresult(processor) ⇒ Object
Constructor Details
#initialize(counter) ⇒ StandardOutput
Returns a new instance of StandardOutput.
13 14 15 |
# File 'lib/ciat/feedback/standard_output.rb', line 13 def initialize(counter) @counter = counter end |
Instance Method Details
#post_tests(suite) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/ciat/feedback/standard_output.rb', line 21 def post_tests(suite) print "\n" print "#{suite.size} tests executed" print ", #{@counter.failure_count} failures" if @counter.failure_count > 0 print ", #{@counter.error_count} errors" if @counter.error_count > 0 print ".\n" end |
#pre_tests(suite) ⇒ Object
17 18 19 |
# File 'lib/ciat/feedback/standard_output.rb', line 17 def pre_tests(suite) nil end |
#report_subresult(processor) ⇒ Object
29 30 31 |
# File 'lib/ciat/feedback/standard_output.rb', line 29 def report_subresult(processor) putc LIGHT_OUTPUTS[processor.light] end |