Class: CIAT::Feedback::FeedbackCounter

Inherits:
Object
  • Object
show all
Defined in:
lib/ciat/feedback/feedback_counter.rb

Overview

This feedback class sends some simple messages to the screen about the progress of a CIAT::Suite run.

Instance Method Summary collapse

Constructor Details

#initializeFeedbackCounter

Returns a new instance of FeedbackCounter.



6
7
8
9
10
11
12
13
14
# File 'lib/ciat/feedback/feedback_counter.rb', line 6

def initialize
  @counts = {
    CIAT::TrafficLight::RED => 0,
    CIAT::TrafficLight::YELLOW => 0,
    CIAT::TrafficLight::GREEN => 0,
    CIAT::TrafficLight::UNSET => 0,
    CIAT::TrafficLight::UNNEEDED => 0
  }
end

Instance Method Details

#error_countObject



16
17
18
# File 'lib/ciat/feedback/feedback_counter.rb', line 16

def error_count
  @counts[CIAT::TrafficLight::YELLOW]
end

#failure_countObject



20
21
22
# File 'lib/ciat/feedback/feedback_counter.rb', line 20

def failure_count
  @counts[CIAT::TrafficLight::RED]
end

#post_tests(suite) ⇒ Object



28
29
30
# File 'lib/ciat/feedback/feedback_counter.rb', line 28

def post_tests(suite)
  nil
end

#pre_tests(suite) ⇒ Object



24
25
26
# File 'lib/ciat/feedback/feedback_counter.rb', line 24

def pre_tests(suite)
  nil
end

#report_subresult(subresult) ⇒ Object



32
33
34
# File 'lib/ciat/feedback/feedback_counter.rb', line 32

def report_subresult(subresult)
  @counts[subresult.light] = @counts[subresult.light] + 1
end