Class: TestStatus
Overview
The TestStatus module defines all the possible statuses for tests and steps
Constant Summary collapse
- NOT_RUN =
:'not run'
- RUNNING =
:running
- PASSED =
:passed
- DONE =
currently, performance tests do not pass or fail in TMC–this is determined by SWORD
:done
- FAILED =
:failed
- ERROR =
:error
Instance Attribute Summary collapse
-
#backtrace ⇒ Object
readonly
Returns the value of attribute backtrace.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#trace ⇒ Object
readonly
Returns the value of attribute trace.
Instance Method Summary collapse
-
#initialize(test_case, status, reason: nil, backtrace: nil, exception: nil, trace: nil) ⇒ TestStatus
constructor
A new instance of TestStatus.
- #to_h ⇒ Object
Constructor Details
#initialize(test_case, status, reason: nil, backtrace: nil, exception: nil, trace: nil) ⇒ TestStatus
Returns a new instance of TestStatus.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/test_case/test_status.rb', line 14 def initialize(test_case, status, reason: nil, backtrace: nil, exception: nil, trace: nil) @status = status @backtrace = exception.nil? ? backtrace : exception.backtrace if !exception.nil? if (exception. || '').empty? @reason = exception.class.name else @reason = exception. end else @reason = reason end if !@backtrace.nil? @trace = TestTrace.new(test_case, @backtrace) else @trace = trace end end |
Instance Attribute Details
#backtrace ⇒ Object (readonly)
Returns the value of attribute backtrace.
12 13 14 |
# File 'lib/test_case/test_status.rb', line 12 def backtrace @backtrace end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
12 13 14 |
# File 'lib/test_case/test_status.rb', line 12 def reason @reason end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
12 13 14 |
# File 'lib/test_case/test_status.rb', line 12 def status @status end |
#trace ⇒ Object (readonly)
Returns the value of attribute trace.
12 13 14 |
# File 'lib/test_case/test_status.rb', line 12 def trace @trace end |
Instance Method Details
#to_h ⇒ Object
33 34 35 36 37 38 |
# File 'lib/test_case/test_status.rb', line 33 def to_h { status: @status.to_s, reason: @reason }.merge(@trace.nil? ? {} : @trace.to_h) end |