Class: TestResult
- Inherits:
-
Object
- Object
- TestResult
- Defined in:
- lib/testresult.rb
Overview
Parsed test results for reporting back
Instance Attribute Summary collapse
-
#failure_type ⇒ Object
readonly
Returns the value of attribute failure_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, status, time, output, parsed_errors, failure_type) ⇒ TestResult
constructor
A new instance of TestResult.
- #inspect ⇒ Object
- #passed ⇒ Object
- #warning ⇒ Object
Constructor Details
#initialize(name, status, time, output, parsed_errors, failure_type) ⇒ TestResult
Returns a new instance of TestResult
19 20 21 22 23 24 25 26 |
# File 'lib/testresult.rb', line 19 def initialize(name, status, time, output, parsed_errors, failure_type) @name = name @status = status @time = time @output = output @parsed_errors = parsed_errors @failure_type = failure_type end |
Instance Attribute Details
#failure_type ⇒ Object (readonly)
Returns the value of attribute failure_type
17 18 19 |
# File 'lib/testresult.rb', line 17 def failure_type @failure_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name
17 18 19 |
# File 'lib/testresult.rb', line 17 def name @name end |
Instance Method Details
#inspect ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/testresult.rb', line 36 def inspect parsed_errors_array = [] @parsed_errors&.each { |e| parsed_errors_array << e.inspect } { :name => @name, :status => @status, :time => @time, :output => @output, :parsed_errors => parsed_errors_array, :failure_type => @failure_type } end |
#passed ⇒ Object
28 29 30 |
# File 'lib/testresult.rb', line 28 def passed @status == 'passed' || @status == 'warning' end |
#warning ⇒ Object
32 33 34 |
# File 'lib/testresult.rb', line 32 def warning @status == 'warning' end |