Class: TestRail::TestResult
- Inherits:
-
Object
- Object
- TestRail::TestResult
- Defined in:
- lib/testrail/test_result.rb
Constant Summary collapse
- STATUS_SUCCESS =
1
- STATUS_ERROR =
5
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#success ⇒ Object
(also: #success?)
readonly
Returns the value of attribute success.
Instance Method Summary collapse
-
#initialize(test_case:, success:, comment:) ⇒ TestResult
constructor
A new instance of TestResult.
- #status_id ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(test_case:, success:, comment:) ⇒ TestResult
Returns a new instance of TestResult.
26 27 28 29 30 |
# File 'lib/testrail/test_result.rb', line 26 def initialize(test_case:, success:, comment:) @test_case = test_case @success = success @comment = comment end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
22 23 24 |
# File 'lib/testrail/test_result.rb', line 22 def comment @comment end |
#success ⇒ Object (readonly) Also known as: success?
Returns the value of attribute success.
23 24 25 |
# File 'lib/testrail/test_result.rb', line 23 def success @success end |
Instance Method Details
#status_id ⇒ Object
32 33 34 |
# File 'lib/testrail/test_result.rb', line 32 def status_id success? ? STATUS_SUCCESS : STATUS_ERROR end |
#to_hash ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/testrail/test_result.rb', line 36 def to_hash { 'case_id': @test_case.id, 'status_id': status_id, 'comment': comment } end |