Class: TestRail::TestResult

Inherits:
Object
  • Object
show all
Defined in:
lib/testrail/test_result.rb

Constant Summary collapse

STATUS_SUCCESS =
1
STATUS_ERROR =
5

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commentObject (readonly)

Returns the value of attribute comment.



22
23
24
# File 'lib/testrail/test_result.rb', line 22

def comment
  @comment
end

#successObject (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_idObject



32
33
34
# File 'lib/testrail/test_result.rb', line 32

def status_id
  success? ? STATUS_SUCCESS : STATUS_ERROR
end

#to_hashObject



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