Class: Trainer::XCResult::Repetition
- Inherits:
-
Object
- Object
- Trainer::XCResult::Repetition
- Includes:
- TestCaseAttributes
- Defined in:
- trainer/lib/trainer/xcresult/repetition.rb
Overview
Represents retries of a test case, including the original run e.g. a test case that ran 3 times in total will be represented by 3 Repetition instances in the ‘xcresulttool` JSON output, one for the original run and one for the 2 retries.
Instance Attribute Summary collapse
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#failure_messages ⇒ Object
readonly
Returns the value of attribute failure_messages.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#source_references ⇒ Object
readonly
Returns the value of attribute source_references.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, duration:, result:, failure_messages: [], source_references: [], attachments: []) ⇒ Repetition
constructor
A new instance of Repetition.
Methods included from TestCaseAttributes
#failed?, included, #passed?, #skipped?
Constructor Details
#initialize(name:, duration:, result:, failure_messages: [], source_references: [], attachments: []) ⇒ Repetition
Returns a new instance of Repetition.
18 19 20 21 22 23 24 25 |
# File 'trainer/lib/trainer/xcresult/repetition.rb', line 18 def initialize(name:, duration:, result:, failure_messages: [], source_references: [], attachments: []) @name = name @duration = duration @result = result @failure_messages = @source_references = source_references @attachments = end |
Instance Attribute Details
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
16 17 18 |
# File 'trainer/lib/trainer/xcresult/repetition.rb', line 16 def @attachments end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
12 13 14 |
# File 'trainer/lib/trainer/xcresult/repetition.rb', line 12 def duration @duration end |
#failure_messages ⇒ Object (readonly)
Returns the value of attribute failure_messages.
14 15 16 |
# File 'trainer/lib/trainer/xcresult/repetition.rb', line 14 def @failure_messages end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'trainer/lib/trainer/xcresult/repetition.rb', line 11 def name @name end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
13 14 15 |
# File 'trainer/lib/trainer/xcresult/repetition.rb', line 13 def result @result end |
#source_references ⇒ Object (readonly)
Returns the value of attribute source_references.
15 16 17 |
# File 'trainer/lib/trainer/xcresult/repetition.rb', line 15 def source_references @source_references end |
Class Method Details
.from_json(node:) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'trainer/lib/trainer/xcresult/repetition.rb', line 27 def self.from_json(node:) new( name: node['name'], duration: parse_duration(node['duration']), result: node['result'], failure_messages: (node), source_references: extract_source_references(node), attachments: (node) ) end |