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