Class: TestResults
- Inherits:
-
Object
- Object
- TestResults
- Defined in:
- lib/hanoi/test_results.rb
Instance Attribute Summary collapse
-
#assertions ⇒ Object
readonly
Returns the value of attribute assertions.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#failures ⇒ Object
readonly
Returns the value of attribute failures.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#modules ⇒ Object
readonly
Returns the value of attribute modules.
-
#tests ⇒ Object
readonly
Returns the value of attribute tests.
Instance Method Summary collapse
- #error? ⇒ Boolean
- #failure? ⇒ Boolean
-
#initialize(query, filename) ⇒ TestResults
constructor
A new instance of TestResults.
- #to_s ⇒ Object
Constructor Details
#initialize(query, filename) ⇒ TestResults
Returns a new instance of TestResults.
3 4 5 6 7 8 9 10 |
# File 'lib/hanoi/test_results.rb', line 3 def initialize(query, filename) @modules = query['modules'].to_i @tests = query['tests'].to_i @assertions = query['assertions'].to_i @failures = query['failures'].to_i @errors = query['errors'].to_i @filename = filename end |
Instance Attribute Details
#assertions ⇒ Object (readonly)
Returns the value of attribute assertions.
2 3 4 |
# File 'lib/hanoi/test_results.rb', line 2 def assertions @assertions end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
2 3 4 |
# File 'lib/hanoi/test_results.rb', line 2 def errors @errors end |
#failures ⇒ Object (readonly)
Returns the value of attribute failures.
2 3 4 |
# File 'lib/hanoi/test_results.rb', line 2 def failures @failures end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
2 3 4 |
# File 'lib/hanoi/test_results.rb', line 2 def filename @filename end |
#modules ⇒ Object (readonly)
Returns the value of attribute modules.
2 3 4 |
# File 'lib/hanoi/test_results.rb', line 2 def modules @modules end |
#tests ⇒ Object (readonly)
Returns the value of attribute tests.
2 3 4 |
# File 'lib/hanoi/test_results.rb', line 2 def tests @tests end |
Instance Method Details
#error? ⇒ Boolean
12 13 14 |
# File 'lib/hanoi/test_results.rb', line 12 def error? @errors > 0 end |
#failure? ⇒ Boolean
16 17 18 |
# File 'lib/hanoi/test_results.rb', line 16 def failure? @failures > 0 end |
#to_s ⇒ Object
20 21 22 23 24 |
# File 'lib/hanoi/test_results.rb', line 20 def to_s return "E" if error? return "F" if failure? "." end |