Class: Cucumber::Messages::TestRunHookFinished
- Defined in:
- lib/cucumber/messages/test_run_hook_finished.rb
Overview
Represents the TestRunHookFinished message in Cucumber’s message protocol.
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#test_run_hook_started_id ⇒ Object
readonly
Identifier for the hook execution that has finished.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Returns a new TestRunHookFinished from the given hash.
Instance Method Summary collapse
-
#initialize(test_run_hook_started_id: '', result: TestStepResult.new, timestamp: Timestamp.new) ⇒ TestRunHookFinished
constructor
A new instance of TestRunHookFinished.
Methods inherited from Message
camelize, from_json, #to_h, #to_json
Constructor Details
#initialize(test_run_hook_started_id: '', result: TestStepResult.new, timestamp: Timestamp.new) ⇒ TestRunHookFinished
Returns a new instance of TestRunHookFinished.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/cucumber/messages/test_run_hook_finished.rb', line 20 def initialize( test_run_hook_started_id: '', result: TestStepResult.new, timestamp: Timestamp.new ) @test_run_hook_started_id = test_run_hook_started_id @result = result @timestamp = super() end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
16 17 18 |
# File 'lib/cucumber/messages/test_run_hook_finished.rb', line 16 def result @result end |
#test_run_hook_started_id ⇒ Object (readonly)
Identifier for the hook execution that has finished
14 15 16 |
# File 'lib/cucumber/messages/test_run_hook_finished.rb', line 14 def test_run_hook_started_id @test_run_hook_started_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
18 19 20 |
# File 'lib/cucumber/messages/test_run_hook_finished.rb', line 18 def @timestamp end |
Class Method Details
.from_h(hash) ⇒ Object
Returns a new TestRunHookFinished from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.
Cucumber::Messages::TestRunHookFinished.from_h(some_hash) # => #<Cucumber::Messages::TestRunHookFinished:0x... ...>
38 39 40 41 42 43 44 45 46 |
# File 'lib/cucumber/messages/test_run_hook_finished.rb', line 38 def self.from_h(hash) return nil if hash.nil? new( test_run_hook_started_id: hash[:testRunHookStartedId], result: TestStepResult.from_h(hash[:result]), timestamp: Timestamp.from_h(hash[:timestamp]) ) end |