Class: Cucumber::Messages::TestRunStarted

Inherits:
Message
  • Object
show all
Defined in:
lib/cucumber/messages/test_run_started.rb

Overview

Represents the TestRunStarted message in Cucumber’s message protocol.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Message

camelize, from_json, #to_h, #to_json

Constructor Details

#initialize(timestamp: Timestamp.new) ⇒ TestRunStarted

Returns a new instance of TestRunStarted.



13
14
15
16
17
18
# File 'lib/cucumber/messages/test_run_started.rb', line 13

def initialize(
  timestamp: Timestamp.new
)
  @timestamp = timestamp
  super()
end

Instance Attribute Details

#timestampObject (readonly)

Returns the value of attribute timestamp.



11
12
13
# File 'lib/cucumber/messages/test_run_started.rb', line 11

def timestamp
  @timestamp
end

Class Method Details

.from_h(hash) ⇒ Object

Returns a new TestRunStarted from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.

Cucumber::Messages::TestRunStarted.from_h(some_hash) # => #<Cucumber::Messages::TestRunStarted:0x... ...>


27
28
29
30
31
32
33
# File 'lib/cucumber/messages/test_run_started.rb', line 27

def self.from_h(hash)
  return nil if hash.nil?

  new(
    timestamp: Timestamp.from_h(hash[:timestamp])
  )
end