Class: TestSuiteResults
- Inherits:
-
Object
- Object
- TestSuiteResults
- Defined in:
- lib/zfben_hanoi/test_suite_results.rb
Instance Method Summary collapse
- #<<(result) ⇒ Object
- #failed? ⇒ Boolean
-
#initialize ⇒ TestSuiteResults
constructor
A new instance of TestSuiteResults.
- #summary ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ TestSuiteResults
Returns a new instance of TestSuiteResults.
2 3 4 5 6 7 |
# File 'lib/zfben_hanoi/test_suite_results.rb', line 2 def initialize @total = 0 @passed = 0 @failed = 0 @failed_files = [] end |
Instance Method Details
#<<(result) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/zfben_hanoi/test_suite_results.rb', line 9 def <<(result) @total += result.total @passed += result.passed @failed += result.failed @failed_files.push(result.filename) if result.failed? end |
#failed? ⇒ Boolean
16 17 18 |
# File 'lib/zfben_hanoi/test_suite_results.rb', line 16 def failed? @failed > 0 end |
#summary ⇒ Object
26 27 28 |
# File 'lib/zfben_hanoi/test_suite_results.rb', line 26 def summary "#{@total} tests, #{@passed} passed, #{@failed} failed." end |
#to_s ⇒ Object
20 21 22 23 24 |
# File 'lib/zfben_hanoi/test_suite_results.rb', line 20 def to_s str = "" str << "\n Filed: #{@failed_files.join(', ')}" if failed? "#{str}\n#{summary}\n\n" end |