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.
12 13 14 15 16 |
# File 'lib/testrail/test_result.rb', line 12 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.
8 9 10 |
# File 'lib/testrail/test_result.rb', line 8 def comment @comment end |
#success ⇒ Object (readonly) Also known as: success?
Returns the value of attribute success.
9 10 11 |
# File 'lib/testrail/test_result.rb', line 9 def success @success end |
Instance Method Details
#status_id ⇒ Object
18 19 20 |
# File 'lib/testrail/test_result.rb', line 18 def status_id success? ? STATUS_SUCCESS : STATUS_ERROR end |
#to_hash ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/testrail/test_result.rb', line 22 def to_hash { 'case_id': @test_case.id, 'status_id': status_id, 'comment': comment } end |