cucumber-messages 22.0.0 → 27.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +2 -2
  3. data/README.md +1 -0
  4. data/VERSION +1 -1
  5. data/lib/cucumber/messages/attachment.rb +131 -0
  6. data/lib/cucumber/messages/attachment_content_encoding.rb +11 -0
  7. data/lib/cucumber/messages/background.rb +64 -0
  8. data/lib/cucumber/messages/ci.rb +62 -0
  9. data/lib/cucumber/messages/comment.rb +50 -0
  10. data/lib/cucumber/messages/data_table.rb +41 -0
  11. data/lib/cucumber/messages/doc_string.rb +51 -0
  12. data/lib/cucumber/messages/duration.rb +50 -0
  13. data/lib/cucumber/messages/envelope.rb +134 -0
  14. data/lib/cucumber/messages/examples.rb +74 -0
  15. data/lib/cucumber/messages/exception.rb +57 -0
  16. data/lib/cucumber/messages/feature.rb +87 -0
  17. data/lib/cucumber/messages/feature_child.rb +49 -0
  18. data/lib/cucumber/messages/gherkin_document.rb +62 -0
  19. data/lib/cucumber/messages/git.rb +54 -0
  20. data/lib/cucumber/messages/group.rb +46 -0
  21. data/lib/cucumber/messages/helpers/id_generator/incrementing.rb +20 -0
  22. data/lib/cucumber/messages/helpers/id_generator/uuid.rb +17 -0
  23. data/lib/cucumber/messages/helpers/id_generator.rb +4 -0
  24. data/lib/cucumber/messages/helpers/ndjson_to_message_enumerator.rb +30 -0
  25. data/lib/cucumber/messages/helpers/time_conversion.rb +31 -0
  26. data/lib/cucumber/messages/hook.rb +56 -0
  27. data/lib/cucumber/messages/hook_type.rb +15 -0
  28. data/lib/cucumber/messages/java_method.rb +46 -0
  29. data/lib/cucumber/messages/java_stack_trace_element.rb +46 -0
  30. data/lib/cucumber/messages/location.rb +44 -0
  31. data/lib/cucumber/messages/message.rb +93 -5
  32. data/lib/cucumber/messages/meta.rb +81 -0
  33. data/lib/cucumber/messages/parameter_type.rb +64 -0
  34. data/lib/cucumber/messages/parse_error.rb +41 -0
  35. data/lib/cucumber/messages/pickle.rb +107 -0
  36. data/lib/cucumber/messages/pickle_doc_string.rb +41 -0
  37. data/lib/cucumber/messages/pickle_step.rb +71 -0
  38. data/lib/cucumber/messages/pickle_step_argument.rb +43 -0
  39. data/lib/cucumber/messages/pickle_step_type.rb +13 -0
  40. data/lib/cucumber/messages/pickle_table.rb +36 -0
  41. data/lib/cucumber/messages/pickle_table_cell.rb +36 -0
  42. data/lib/cucumber/messages/pickle_table_row.rb +36 -0
  43. data/lib/cucumber/messages/pickle_tag.rb +47 -0
  44. data/lib/cucumber/messages/product.rb +49 -0
  45. data/lib/cucumber/messages/rule.rb +72 -0
  46. data/lib/cucumber/messages/rule_child.rb +44 -0
  47. data/lib/cucumber/messages/scenario.rb +74 -0
  48. data/lib/cucumber/messages/source.rb +63 -0
  49. data/lib/cucumber/messages/source_media_type.rb +11 -0
  50. data/lib/cucumber/messages/source_reference.rb +55 -0
  51. data/lib/cucumber/messages/step.rb +80 -0
  52. data/lib/cucumber/messages/step_definition.rb +46 -0
  53. data/lib/cucumber/messages/step_definition_pattern.rb +41 -0
  54. data/lib/cucumber/messages/step_definition_pattern_type.rb +11 -0
  55. data/lib/cucumber/messages/step_keyword_type.rb +14 -0
  56. data/lib/cucumber/messages/step_match_argument.rb +54 -0
  57. data/lib/cucumber/messages/step_match_arguments_list.rb +36 -0
  58. data/lib/cucumber/messages/table_cell.rb +49 -0
  59. data/lib/cucumber/messages/table_row.rb +54 -0
  60. data/lib/cucumber/messages/tag.rb +58 -0
  61. data/lib/cucumber/messages/test_case.rb +62 -0
  62. data/lib/cucumber/messages/test_case_finished.rb +46 -0
  63. data/lib/cucumber/messages/test_case_started.rb +69 -0
  64. data/lib/cucumber/messages/test_run_finished.rb +68 -0
  65. data/lib/cucumber/messages/test_run_hook_finished.rb +49 -0
  66. data/lib/cucumber/messages/test_run_hook_started.rb +60 -0
  67. data/lib/cucumber/messages/test_run_started.rb +41 -0
  68. data/lib/cucumber/messages/test_step.rb +74 -0
  69. data/lib/cucumber/messages/test_step_finished.rb +51 -0
  70. data/lib/cucumber/messages/test_step_result.rb +57 -0
  71. data/lib/cucumber/messages/test_step_result_status.rb +16 -0
  72. data/lib/cucumber/messages/test_step_started.rb +46 -0
  73. data/lib/cucumber/messages/timestamp.rb +52 -0
  74. data/lib/cucumber/messages/undefined_parameter_type.rb +41 -0
  75. data/lib/cucumber/messages.rb +9 -5
  76. metadata +140 -61
  77. data/lib/cucumber/messages/id_generator.rb +0 -24
  78. data/lib/cucumber/messages/message/deserialization.rb +0 -39
  79. data/lib/cucumber/messages/message/serialization.rb +0 -73
  80. data/lib/cucumber/messages/message/utils.rb +0 -46
  81. data/lib/cucumber/messages/ndjson_to_message_enumerator.rb +0 -21
  82. data/lib/cucumber/messages/time_conversion.rb +0 -33
  83. data/lib/cucumber/messages.deserializers.rb +0 -1207
  84. data/lib/cucumber/messages.dtos.rb +0 -2000
  85. data/spec/capture_warnings.rb +0 -74
  86. data/spec/cucumber/messages/acceptance_spec.rb +0 -33
  87. data/spec/cucumber/messages/id_generator_spec.rb +0 -29
  88. data/spec/cucumber/messages/message/deserialization_spec.rb +0 -30
  89. data/spec/cucumber/messages/message/dummy_messages.rb +0 -38
  90. data/spec/cucumber/messages/message/serialization_spec.rb +0 -89
  91. data/spec/cucumber/messages/message/utils_spec.rb +0 -30
  92. data/spec/cucumber/messages/ndjson_serialization_spec.rb +0 -56
  93. data/spec/cucumber/messages/time_conversion_spec.rb +0 -41
  94. data/spec/cucumber/messages/version_spec.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bc766d1b3813a86b29e6616ac619ef081524af03bc0b0ca13ee43030a7f58b8
4
- data.tar.gz: 8c59570b04a951846405534ad80f8ff06d93db4bb00ae719d005446e13724fc2
3
+ metadata.gz: 7df1a72a47d98cbc019ee52d52f81d32f6af01171359de6cdfbc70493ac9ea69
4
+ data.tar.gz: af04b94178bbb35139f79d8ea9cd5ced4fe9e791b8c4d282988c5a14f7bed20c
5
5
  SHA512:
6
- metadata.gz: 6e65adff9ca721a531a29d11a82ddd7a229fb67aca4aec3defa97e08265bd8f64798b8c989c570e8bed2be8a79db51864fbc4040216681879d70b7915ce0e0b5
7
- data.tar.gz: 3a052b3971dbc65aadad22cb7d9a6a903ab9b8fbe2558722e9cbefd558ed5761d23c8859df15dac0219a13dd6ed205c5f1fdd061273c6adf8b93e0157cb55529
6
+ metadata.gz: d7a247adaa729f4405dc675d304beed0cf9002a9b0437f0ef19946524169bccd5931ac4df1cdfd14f041bf15b59ecf0753d3fe304c0a17d71ad8a74af4eb4759
7
+ data.tar.gz: 81918251fa112bfc2819b709bb6905dc108a1af42249cf147e4cef211ff44037febbb3a9238ce04ae1bed1ef7a0adc6aa5b039fe9a48422ccfccaa0bb0076604
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
- Copyright (c) Cucumber Ltd
3
+ Copyright (c) 2018 Cucumber Ltd and contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,2 +1,3 @@
1
1
  # Cucumber Messages for Ruby (JSON schema)
2
2
 
3
+ See main [README](../README.md)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 22.0.0
1
+ 27.2.0
@@ -0,0 +1,131 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/codegen/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the Attachment message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ #
10
+ # //// Attachments (parse errors, execution errors, screenshots, links...)
11
+ #
12
+ # *
13
+ # An attachment represents any kind of data associated with a line in a
14
+ # [Source](#io.cucumber.messages.Source) file. It can be used for:
15
+ #
16
+ # * Syntax errors during parse time
17
+ # * Screenshots captured and attached during execution
18
+ # * Logs captured and attached during execution
19
+ #
20
+ # It is not to be used for runtime errors raised/thrown during execution. This
21
+ # is captured in `TestResult`.
22
+ ##
23
+ class Attachment < Message
24
+ ##
25
+ # *
26
+ # The body of the attachment. If `contentEncoding` is `IDENTITY`, the attachment
27
+ # is simply the string. If it's `BASE64`, the string should be Base64 decoded to
28
+ # obtain the attachment.
29
+ ##
30
+ attr_reader :body
31
+
32
+ ##
33
+ # *
34
+ # Whether to interpret `body` "as-is" (IDENTITY) or if it needs to be Base64-decoded (BASE64).
35
+ #
36
+ # Content encoding is *not* determined by the media type, but rather by the type
37
+ # of the object being attached:
38
+ #
39
+ # - string: IDENTITY
40
+ # - byte array: BASE64
41
+ # - stream: BASE64
42
+ ##
43
+ attr_reader :content_encoding
44
+
45
+ ##
46
+ # *
47
+ # Suggested file name of the attachment. (Provided by the user as an argument to `attach`)
48
+ ##
49
+ attr_reader :file_name
50
+
51
+ ##
52
+ # *
53
+ # The media type of the data. This can be any valid
54
+ # [IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml)
55
+ # as well as Cucumber-specific media types such as `text/x.cucumber.gherkin+plain`
56
+ # and `text/x.cucumber.stacktrace+plain`
57
+ ##
58
+ attr_reader :media_type
59
+
60
+ attr_reader :source
61
+
62
+ attr_reader :test_case_started_id
63
+
64
+ attr_reader :test_step_id
65
+
66
+ ##
67
+ # *
68
+ # A URL where the attachment can be retrieved. This field should not be set by Cucumber.
69
+ # It should be set by a program that reads a message stream and does the following for
70
+ # each Attachment message:
71
+ #
72
+ # - Writes the body (after base64 decoding if necessary) to a new file.
73
+ # - Sets `body` and `contentEncoding` to `null`
74
+ # - Writes out the new attachment message
75
+ #
76
+ # This will result in a smaller message stream, which can improve performance and
77
+ # reduce bandwidth of message consumers. It also makes it easier to process and download attachments
78
+ # separately from reports.
79
+ ##
80
+ attr_reader :url
81
+
82
+ attr_reader :test_run_started_id
83
+
84
+ def initialize(
85
+ body: '',
86
+ content_encoding: AttachmentContentEncoding::IDENTITY,
87
+ file_name: nil,
88
+ media_type: '',
89
+ source: nil,
90
+ test_case_started_id: nil,
91
+ test_step_id: nil,
92
+ url: nil,
93
+ test_run_started_id: nil
94
+ )
95
+ @body = body
96
+ @content_encoding = content_encoding
97
+ @file_name = file_name
98
+ @media_type = media_type
99
+ @source = source
100
+ @test_case_started_id = test_case_started_id
101
+ @test_step_id = test_step_id
102
+ @url = url
103
+ @test_run_started_id = test_run_started_id
104
+ super()
105
+ end
106
+
107
+ ##
108
+ # Returns a new Attachment from the given hash.
109
+ # If the hash keys are camelCased, they are properly assigned to the
110
+ # corresponding snake_cased attributes.
111
+ #
112
+ # Cucumber::Messages::Attachment.from_h(some_hash) # => #<Cucumber::Messages::Attachment:0x... ...>
113
+ ##
114
+ def self.from_h(hash)
115
+ return nil if hash.nil?
116
+
117
+ new(
118
+ body: hash[:body],
119
+ content_encoding: hash[:contentEncoding],
120
+ file_name: hash[:fileName],
121
+ media_type: hash[:mediaType],
122
+ source: Source.from_h(hash[:source]),
123
+ test_case_started_id: hash[:testCaseStartedId],
124
+ test_step_id: hash[:testStepId],
125
+ url: hash[:url],
126
+ test_run_started_id: hash[:testRunStartedId]
127
+ )
128
+ end
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/codegen/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ class AttachmentContentEncoding
7
+ IDENTITY = 'IDENTITY'
8
+ BASE64 = 'BASE64'
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/codegen/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the Background message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ ##
10
+ class Background < Message
11
+ ##
12
+ # The location of the `Background` keyword
13
+ ##
14
+ attr_reader :location
15
+
16
+ attr_reader :keyword
17
+
18
+ attr_reader :name
19
+
20
+ attr_reader :description
21
+
22
+ attr_reader :steps
23
+
24
+ attr_reader :id
25
+
26
+ def initialize(
27
+ location: Location.new,
28
+ keyword: '',
29
+ name: '',
30
+ description: '',
31
+ steps: [],
32
+ id: ''
33
+ )
34
+ @location = location
35
+ @keyword = keyword
36
+ @name = name
37
+ @description = description
38
+ @steps = steps
39
+ @id = id
40
+ super()
41
+ end
42
+
43
+ ##
44
+ # Returns a new Background from the given hash.
45
+ # If the hash keys are camelCased, they are properly assigned to the
46
+ # corresponding snake_cased attributes.
47
+ #
48
+ # Cucumber::Messages::Background.from_h(some_hash) # => #<Cucumber::Messages::Background:0x... ...>
49
+ ##
50
+ def self.from_h(hash)
51
+ return nil if hash.nil?
52
+
53
+ new(
54
+ location: Location.from_h(hash[:location]),
55
+ keyword: hash[:keyword],
56
+ name: hash[:name],
57
+ description: hash[:description],
58
+ steps: hash[:steps]&.map { |item| Step.from_h(item) },
59
+ id: hash[:id]
60
+ )
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/codegen/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the Ci message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ #
10
+ # CI environment
11
+ ##
12
+ class Ci < Message
13
+ ##
14
+ # Name of the CI product, e.g. "Jenkins", "CircleCI" etc.
15
+ ##
16
+ attr_reader :name
17
+
18
+ ##
19
+ # Link to the build
20
+ ##
21
+ attr_reader :url
22
+
23
+ ##
24
+ # The build number. Some CI servers use non-numeric build numbers, which is why this is a string
25
+ ##
26
+ attr_reader :build_number
27
+
28
+ attr_reader :git
29
+
30
+ def initialize(
31
+ name: '',
32
+ url: nil,
33
+ build_number: nil,
34
+ git: nil
35
+ )
36
+ @name = name
37
+ @url = url
38
+ @build_number = build_number
39
+ @git = git
40
+ super()
41
+ end
42
+
43
+ ##
44
+ # Returns a new Ci from the given hash.
45
+ # If the hash keys are camelCased, they are properly assigned to the
46
+ # corresponding snake_cased attributes.
47
+ #
48
+ # Cucumber::Messages::Ci.from_h(some_hash) # => #<Cucumber::Messages::Ci:0x... ...>
49
+ ##
50
+ def self.from_h(hash)
51
+ return nil if hash.nil?
52
+
53
+ new(
54
+ name: hash[:name],
55
+ url: hash[:url],
56
+ build_number: hash[:buildNumber],
57
+ git: Git.from_h(hash[:git])
58
+ )
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/codegen/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the Comment message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ #
10
+ # *
11
+ # A comment in a Gherkin document
12
+ ##
13
+ class Comment < Message
14
+ ##
15
+ # The location of the comment
16
+ ##
17
+ attr_reader :location
18
+
19
+ ##
20
+ # The text of the comment
21
+ ##
22
+ attr_reader :text
23
+
24
+ def initialize(
25
+ location: Location.new,
26
+ text: ''
27
+ )
28
+ @location = location
29
+ @text = text
30
+ super()
31
+ end
32
+
33
+ ##
34
+ # Returns a new Comment from the given hash.
35
+ # If the hash keys are camelCased, they are properly assigned to the
36
+ # corresponding snake_cased attributes.
37
+ #
38
+ # Cucumber::Messages::Comment.from_h(some_hash) # => #<Cucumber::Messages::Comment:0x... ...>
39
+ ##
40
+ def self.from_h(hash)
41
+ return nil if hash.nil?
42
+
43
+ new(
44
+ location: Location.from_h(hash[:location]),
45
+ text: hash[:text]
46
+ )
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/codegen/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the DataTable message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ ##
10
+ class DataTable < Message
11
+ attr_reader :location
12
+
13
+ attr_reader :rows
14
+
15
+ def initialize(
16
+ location: Location.new,
17
+ rows: []
18
+ )
19
+ @location = location
20
+ @rows = rows
21
+ super()
22
+ end
23
+
24
+ ##
25
+ # Returns a new DataTable from the given hash.
26
+ # If the hash keys are camelCased, they are properly assigned to the
27
+ # corresponding snake_cased attributes.
28
+ #
29
+ # Cucumber::Messages::DataTable.from_h(some_hash) # => #<Cucumber::Messages::DataTable:0x... ...>
30
+ ##
31
+ def self.from_h(hash)
32
+ return nil if hash.nil?
33
+
34
+ new(
35
+ location: Location.from_h(hash[:location]),
36
+ rows: hash[:rows]&.map { |item| TableRow.from_h(item) }
37
+ )
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/codegen/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the DocString message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ ##
10
+ class DocString < Message
11
+ attr_reader :location
12
+
13
+ attr_reader :media_type
14
+
15
+ attr_reader :content
16
+
17
+ attr_reader :delimiter
18
+
19
+ def initialize(
20
+ location: Location.new,
21
+ media_type: nil,
22
+ content: '',
23
+ delimiter: ''
24
+ )
25
+ @location = location
26
+ @media_type = media_type
27
+ @content = content
28
+ @delimiter = delimiter
29
+ super()
30
+ end
31
+
32
+ ##
33
+ # Returns a new DocString from the given hash.
34
+ # If the hash keys are camelCased, they are properly assigned to the
35
+ # corresponding snake_cased attributes.
36
+ #
37
+ # Cucumber::Messages::DocString.from_h(some_hash) # => #<Cucumber::Messages::DocString:0x... ...>
38
+ ##
39
+ def self.from_h(hash)
40
+ return nil if hash.nil?
41
+
42
+ new(
43
+ location: Location.from_h(hash[:location]),
44
+ media_type: hash[:mediaType],
45
+ content: hash[:content],
46
+ delimiter: hash[:delimiter]
47
+ )
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/codegen/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the Duration message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ #
10
+ # The structure is pretty close of the Timestamp one. For clarity, a second type
11
+ # of message is used.
12
+ ##
13
+ class Duration < Message
14
+ attr_reader :seconds
15
+
16
+ ##
17
+ # Non-negative fractions of a second at nanosecond resolution. Negative
18
+ # second values with fractions must still have non-negative nanos values
19
+ # that count forward in time. Must be from 0 to 999,999,999
20
+ # inclusive.
21
+ ##
22
+ attr_reader :nanos
23
+
24
+ def initialize(
25
+ seconds: 0,
26
+ nanos: 0
27
+ )
28
+ @seconds = seconds
29
+ @nanos = nanos
30
+ super()
31
+ end
32
+
33
+ ##
34
+ # Returns a new Duration from the given hash.
35
+ # If the hash keys are camelCased, they are properly assigned to the
36
+ # corresponding snake_cased attributes.
37
+ #
38
+ # Cucumber::Messages::Duration.from_h(some_hash) # => #<Cucumber::Messages::Duration:0x... ...>
39
+ ##
40
+ def self.from_h(hash)
41
+ return nil if hash.nil?
42
+
43
+ new(
44
+ seconds: hash[:seconds],
45
+ nanos: hash[:nanos]
46
+ )
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,134 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/codegen/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the Envelope message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ #
10
+ # When removing a field, replace it with reserved, rather than deleting the line.
11
+ # When adding a field, add it to the end and increment the number by one.
12
+ # See https://developers.google.com/protocol-buffers/docs/proto#updating for details
13
+ #
14
+ # *
15
+ # All the messages that are passed between different components/processes are Envelope
16
+ # messages.
17
+ ##
18
+ class Envelope < Message
19
+ attr_reader :attachment
20
+
21
+ attr_reader :gherkin_document
22
+
23
+ attr_reader :hook
24
+
25
+ attr_reader :meta
26
+
27
+ attr_reader :parameter_type
28
+
29
+ attr_reader :parse_error
30
+
31
+ attr_reader :pickle
32
+
33
+ attr_reader :source
34
+
35
+ attr_reader :step_definition
36
+
37
+ attr_reader :test_case
38
+
39
+ attr_reader :test_case_finished
40
+
41
+ attr_reader :test_case_started
42
+
43
+ attr_reader :test_run_finished
44
+
45
+ attr_reader :test_run_started
46
+
47
+ attr_reader :test_step_finished
48
+
49
+ attr_reader :test_step_started
50
+
51
+ attr_reader :test_run_hook_started
52
+
53
+ attr_reader :test_run_hook_finished
54
+
55
+ attr_reader :undefined_parameter_type
56
+
57
+ def initialize(
58
+ attachment: nil,
59
+ gherkin_document: nil,
60
+ hook: nil,
61
+ meta: nil,
62
+ parameter_type: nil,
63
+ parse_error: nil,
64
+ pickle: nil,
65
+ source: nil,
66
+ step_definition: nil,
67
+ test_case: nil,
68
+ test_case_finished: nil,
69
+ test_case_started: nil,
70
+ test_run_finished: nil,
71
+ test_run_started: nil,
72
+ test_step_finished: nil,
73
+ test_step_started: nil,
74
+ test_run_hook_started: nil,
75
+ test_run_hook_finished: nil,
76
+ undefined_parameter_type: nil
77
+ )
78
+ @attachment = attachment
79
+ @gherkin_document = gherkin_document
80
+ @hook = hook
81
+ @meta = meta
82
+ @parameter_type = parameter_type
83
+ @parse_error = parse_error
84
+ @pickle = pickle
85
+ @source = source
86
+ @step_definition = step_definition
87
+ @test_case = test_case
88
+ @test_case_finished = test_case_finished
89
+ @test_case_started = test_case_started
90
+ @test_run_finished = test_run_finished
91
+ @test_run_started = test_run_started
92
+ @test_step_finished = test_step_finished
93
+ @test_step_started = test_step_started
94
+ @test_run_hook_started = test_run_hook_started
95
+ @test_run_hook_finished = test_run_hook_finished
96
+ @undefined_parameter_type = undefined_parameter_type
97
+ super()
98
+ end
99
+
100
+ ##
101
+ # Returns a new Envelope from the given hash.
102
+ # If the hash keys are camelCased, they are properly assigned to the
103
+ # corresponding snake_cased attributes.
104
+ #
105
+ # Cucumber::Messages::Envelope.from_h(some_hash) # => #<Cucumber::Messages::Envelope:0x... ...>
106
+ ##
107
+ def self.from_h(hash)
108
+ return nil if hash.nil?
109
+
110
+ new(
111
+ attachment: Attachment.from_h(hash[:attachment]),
112
+ gherkin_document: GherkinDocument.from_h(hash[:gherkinDocument]),
113
+ hook: Hook.from_h(hash[:hook]),
114
+ meta: Meta.from_h(hash[:meta]),
115
+ parameter_type: ParameterType.from_h(hash[:parameterType]),
116
+ parse_error: ParseError.from_h(hash[:parseError]),
117
+ pickle: Pickle.from_h(hash[:pickle]),
118
+ source: Source.from_h(hash[:source]),
119
+ step_definition: StepDefinition.from_h(hash[:stepDefinition]),
120
+ test_case: TestCase.from_h(hash[:testCase]),
121
+ test_case_finished: TestCaseFinished.from_h(hash[:testCaseFinished]),
122
+ test_case_started: TestCaseStarted.from_h(hash[:testCaseStarted]),
123
+ test_run_finished: TestRunFinished.from_h(hash[:testRunFinished]),
124
+ test_run_started: TestRunStarted.from_h(hash[:testRunStarted]),
125
+ test_step_finished: TestStepFinished.from_h(hash[:testStepFinished]),
126
+ test_step_started: TestStepStarted.from_h(hash[:testStepStarted]),
127
+ test_run_hook_started: TestRunHookStarted.from_h(hash[:testRunHookStarted]),
128
+ test_run_hook_finished: TestRunHookFinished.from_h(hash[:testRunHookFinished]),
129
+ undefined_parameter_type: UndefinedParameterType.from_h(hash[:undefinedParameterType])
130
+ )
131
+ end
132
+ end
133
+ end
134
+ end