Class: RIESS::TestReporter
- Inherits:
-
Object
- Object
- RIESS::TestReporter
- Defined in:
- lib/test_reporter.rb
Defined Under Namespace
Classes: Result
Instance Attribute Summary collapse
-
#immediate_feedback ⇒ Object
writeonly
Sets the attribute immediate_feedback.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ TestReporter
constructor
A new instance of TestReporter.
- #locator_not_found(parameter) ⇒ Object
- #record_results(name, expected, actual, value) ⇒ Object
Constructor Details
#initialize ⇒ TestReporter
Returns a new instance of TestReporter.
8 9 10 11 12 13 |
# File 'lib/test_reporter.rb', line 8 def initialize @results = [] @not_found = [] @time_started = Time.now @immediate_feedback = false end |
Instance Attribute Details
#immediate_feedback=(value) ⇒ Object (writeonly)
Sets the attribute immediate_feedback
6 7 8 |
# File 'lib/test_reporter.rb', line 6 def immediate_feedback=(value) @immediate_feedback = value end |
Instance Method Details
#execute ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/test_reporter.rb', line 26 def execute specifications = 0 failures = 0 @results.each{|result| if result.value specifications += 1 else failures += 1 (result) end } unless @results.empty? @not_found.each{|item| if !item failures += 1 end } unless @not_found.empty? time_ended = Time.now elapsed_time = time_ended - @time_started print_results(elapsed_time,specifications,failures) end |
#locator_not_found(parameter) ⇒ Object
21 22 23 24 |
# File 'lib/test_reporter.rb', line 21 def locator_not_found(parameter) (parameter) unless !@immediate_feedback @not_found << false end |