Class: Cucumber::Messages::TestCaseFinished
- Defined in:
- lib/cucumber/messages/test_case_finished.rb
Overview
Represents the TestCaseFinished message in Cucumber’s message protocol.
Instance Attribute Summary collapse
-
#test_case_started_id ⇒ Object
readonly
Returns the value of attribute test_case_started_id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#will_be_retried ⇒ Object
readonly
Returns the value of attribute will_be_retried.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Returns a new TestCaseFinished from the given hash.
Instance Method Summary collapse
-
#initialize(test_case_started_id: '', timestamp: Timestamp.new, will_be_retried: false) ⇒ TestCaseFinished
constructor
A new instance of TestCaseFinished.
Methods inherited from Message
camelize, from_json, #to_h, #to_json
Constructor Details
#initialize(test_case_started_id: '', timestamp: Timestamp.new, will_be_retried: false) ⇒ TestCaseFinished
Returns a new instance of TestCaseFinished.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cucumber/messages/test_case_finished.rb', line 17 def initialize( test_case_started_id: '', timestamp: Timestamp.new, will_be_retried: false ) @test_case_started_id = test_case_started_id @timestamp = @will_be_retried = will_be_retried super() end |
Instance Attribute Details
#test_case_started_id ⇒ Object (readonly)
Returns the value of attribute test_case_started_id.
11 12 13 |
# File 'lib/cucumber/messages/test_case_finished.rb', line 11 def test_case_started_id @test_case_started_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
13 14 15 |
# File 'lib/cucumber/messages/test_case_finished.rb', line 13 def @timestamp end |
#will_be_retried ⇒ Object (readonly)
Returns the value of attribute will_be_retried.
15 16 17 |
# File 'lib/cucumber/messages/test_case_finished.rb', line 15 def will_be_retried @will_be_retried end |
Class Method Details
.from_h(hash) ⇒ Object
Returns a new TestCaseFinished from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.
Cucumber::Messages::TestCaseFinished.from_h(some_hash) # => #<Cucumber::Messages::TestCaseFinished:0x... ...>
35 36 37 38 39 40 41 42 43 |
# File 'lib/cucumber/messages/test_case_finished.rb', line 35 def self.from_h(hash) return nil if hash.nil? new( test_case_started_id: hash[:testCaseStartedId], timestamp: Timestamp.from_h(hash[:timestamp]), will_be_retried: hash[:willBeRetried] ) end |