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
@@ -1,1207 +0,0 @@
1
- require 'cucumber/messages.dtos'
2
- require 'json'
3
-
4
- # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/jsonschema/scripts/codegen.rb]
5
- #
6
-
7
- module Cucumber
8
- module Messages
9
-
10
- class Attachment
11
-
12
- ##
13
- # Returns a new Attachment from the given hash.
14
- # If the hash keys are camelCased, they are properly assigned to the
15
- # corresponding snake_cased attributes.
16
- #
17
- # Cucumber::Messages::Attachment.from_h(some_hash) # => #<Cucumber::Messages::Attachment:0x... ...>
18
- #
19
-
20
- def self.from_h(hash)
21
- return nil if hash.nil?
22
-
23
- self.new(
24
- body: hash[:body],
25
- content_encoding: hash[:contentEncoding],
26
- file_name: hash[:fileName],
27
- media_type: hash[:mediaType],
28
- source: Source.from_h(hash[:source]),
29
- test_case_started_id: hash[:testCaseStartedId],
30
- test_step_id: hash[:testStepId],
31
- url: hash[:url],
32
- )
33
- end
34
- end
35
-
36
- class Duration
37
-
38
- ##
39
- # Returns a new Duration from the given hash.
40
- # If the hash keys are camelCased, they are properly assigned to the
41
- # corresponding snake_cased attributes.
42
- #
43
- # Cucumber::Messages::Duration.from_h(some_hash) # => #<Cucumber::Messages::Duration:0x... ...>
44
- #
45
-
46
- def self.from_h(hash)
47
- return nil if hash.nil?
48
-
49
- self.new(
50
- seconds: hash[:seconds],
51
- nanos: hash[:nanos],
52
- )
53
- end
54
- end
55
-
56
- class Envelope
57
-
58
- ##
59
- # Returns a new Envelope from the given hash.
60
- # If the hash keys are camelCased, they are properly assigned to the
61
- # corresponding snake_cased attributes.
62
- #
63
- # Cucumber::Messages::Envelope.from_h(some_hash) # => #<Cucumber::Messages::Envelope:0x... ...>
64
- #
65
-
66
- def self.from_h(hash)
67
- return nil if hash.nil?
68
-
69
- self.new(
70
- attachment: Attachment.from_h(hash[:attachment]),
71
- gherkin_document: GherkinDocument.from_h(hash[:gherkinDocument]),
72
- hook: Hook.from_h(hash[:hook]),
73
- meta: Meta.from_h(hash[:meta]),
74
- parameter_type: ParameterType.from_h(hash[:parameterType]),
75
- parse_error: ParseError.from_h(hash[:parseError]),
76
- pickle: Pickle.from_h(hash[:pickle]),
77
- source: Source.from_h(hash[:source]),
78
- step_definition: StepDefinition.from_h(hash[:stepDefinition]),
79
- test_case: TestCase.from_h(hash[:testCase]),
80
- test_case_finished: TestCaseFinished.from_h(hash[:testCaseFinished]),
81
- test_case_started: TestCaseStarted.from_h(hash[:testCaseStarted]),
82
- test_run_finished: TestRunFinished.from_h(hash[:testRunFinished]),
83
- test_run_started: TestRunStarted.from_h(hash[:testRunStarted]),
84
- test_step_finished: TestStepFinished.from_h(hash[:testStepFinished]),
85
- test_step_started: TestStepStarted.from_h(hash[:testStepStarted]),
86
- undefined_parameter_type: UndefinedParameterType.from_h(hash[:undefinedParameterType]),
87
- )
88
- end
89
- end
90
-
91
- class Exception
92
-
93
- ##
94
- # Returns a new Exception from the given hash.
95
- # If the hash keys are camelCased, they are properly assigned to the
96
- # corresponding snake_cased attributes.
97
- #
98
- # Cucumber::Messages::Exception.from_h(some_hash) # => #<Cucumber::Messages::Exception:0x... ...>
99
- #
100
-
101
- def self.from_h(hash)
102
- return nil if hash.nil?
103
-
104
- self.new(
105
- type: hash[:type],
106
- message: hash[:message],
107
- )
108
- end
109
- end
110
-
111
- class GherkinDocument
112
-
113
- ##
114
- # Returns a new GherkinDocument from the given hash.
115
- # If the hash keys are camelCased, they are properly assigned to the
116
- # corresponding snake_cased attributes.
117
- #
118
- # Cucumber::Messages::GherkinDocument.from_h(some_hash) # => #<Cucumber::Messages::GherkinDocument:0x... ...>
119
- #
120
-
121
- def self.from_h(hash)
122
- return nil if hash.nil?
123
-
124
- self.new(
125
- uri: hash[:uri],
126
- feature: Feature.from_h(hash[:feature]),
127
- comments: hash[:comments]&.map { |item| Comment.from_h(item) },
128
- )
129
- end
130
- end
131
-
132
- class Background
133
-
134
- ##
135
- # Returns a new Background from the given hash.
136
- # If the hash keys are camelCased, they are properly assigned to the
137
- # corresponding snake_cased attributes.
138
- #
139
- # Cucumber::Messages::Background.from_h(some_hash) # => #<Cucumber::Messages::Background:0x... ...>
140
- #
141
-
142
- def self.from_h(hash)
143
- return nil if hash.nil?
144
-
145
- self.new(
146
- location: Location.from_h(hash[:location]),
147
- keyword: hash[:keyword],
148
- name: hash[:name],
149
- description: hash[:description],
150
- steps: hash[:steps]&.map { |item| Step.from_h(item) },
151
- id: hash[:id],
152
- )
153
- end
154
- end
155
-
156
- class Comment
157
-
158
- ##
159
- # Returns a new Comment from the given hash.
160
- # If the hash keys are camelCased, they are properly assigned to the
161
- # corresponding snake_cased attributes.
162
- #
163
- # Cucumber::Messages::Comment.from_h(some_hash) # => #<Cucumber::Messages::Comment:0x... ...>
164
- #
165
-
166
- def self.from_h(hash)
167
- return nil if hash.nil?
168
-
169
- self.new(
170
- location: Location.from_h(hash[:location]),
171
- text: hash[:text],
172
- )
173
- end
174
- end
175
-
176
- class DataTable
177
-
178
- ##
179
- # Returns a new DataTable from the given hash.
180
- # If the hash keys are camelCased, they are properly assigned to the
181
- # corresponding snake_cased attributes.
182
- #
183
- # Cucumber::Messages::DataTable.from_h(some_hash) # => #<Cucumber::Messages::DataTable:0x... ...>
184
- #
185
-
186
- def self.from_h(hash)
187
- return nil if hash.nil?
188
-
189
- self.new(
190
- location: Location.from_h(hash[:location]),
191
- rows: hash[:rows]&.map { |item| TableRow.from_h(item) },
192
- )
193
- end
194
- end
195
-
196
- class DocString
197
-
198
- ##
199
- # Returns a new DocString from the given hash.
200
- # If the hash keys are camelCased, they are properly assigned to the
201
- # corresponding snake_cased attributes.
202
- #
203
- # Cucumber::Messages::DocString.from_h(some_hash) # => #<Cucumber::Messages::DocString:0x... ...>
204
- #
205
-
206
- def self.from_h(hash)
207
- return nil if hash.nil?
208
-
209
- self.new(
210
- location: Location.from_h(hash[:location]),
211
- media_type: hash[:mediaType],
212
- content: hash[:content],
213
- delimiter: hash[:delimiter],
214
- )
215
- end
216
- end
217
-
218
- class Examples
219
-
220
- ##
221
- # Returns a new Examples from the given hash.
222
- # If the hash keys are camelCased, they are properly assigned to the
223
- # corresponding snake_cased attributes.
224
- #
225
- # Cucumber::Messages::Examples.from_h(some_hash) # => #<Cucumber::Messages::Examples:0x... ...>
226
- #
227
-
228
- def self.from_h(hash)
229
- return nil if hash.nil?
230
-
231
- self.new(
232
- location: Location.from_h(hash[:location]),
233
- tags: hash[:tags]&.map { |item| Tag.from_h(item) },
234
- keyword: hash[:keyword],
235
- name: hash[:name],
236
- description: hash[:description],
237
- table_header: TableRow.from_h(hash[:tableHeader]),
238
- table_body: hash[:tableBody]&.map { |item| TableRow.from_h(item) },
239
- id: hash[:id],
240
- )
241
- end
242
- end
243
-
244
- class Feature
245
-
246
- ##
247
- # Returns a new Feature from the given hash.
248
- # If the hash keys are camelCased, they are properly assigned to the
249
- # corresponding snake_cased attributes.
250
- #
251
- # Cucumber::Messages::Feature.from_h(some_hash) # => #<Cucumber::Messages::Feature:0x... ...>
252
- #
253
-
254
- def self.from_h(hash)
255
- return nil if hash.nil?
256
-
257
- self.new(
258
- location: Location.from_h(hash[:location]),
259
- tags: hash[:tags]&.map { |item| Tag.from_h(item) },
260
- language: hash[:language],
261
- keyword: hash[:keyword],
262
- name: hash[:name],
263
- description: hash[:description],
264
- children: hash[:children]&.map { |item| FeatureChild.from_h(item) },
265
- )
266
- end
267
- end
268
-
269
- class FeatureChild
270
-
271
- ##
272
- # Returns a new FeatureChild from the given hash.
273
- # If the hash keys are camelCased, they are properly assigned to the
274
- # corresponding snake_cased attributes.
275
- #
276
- # Cucumber::Messages::FeatureChild.from_h(some_hash) # => #<Cucumber::Messages::FeatureChild:0x... ...>
277
- #
278
-
279
- def self.from_h(hash)
280
- return nil if hash.nil?
281
-
282
- self.new(
283
- rule: Rule.from_h(hash[:rule]),
284
- background: Background.from_h(hash[:background]),
285
- scenario: Scenario.from_h(hash[:scenario]),
286
- )
287
- end
288
- end
289
-
290
- class Rule
291
-
292
- ##
293
- # Returns a new Rule from the given hash.
294
- # If the hash keys are camelCased, they are properly assigned to the
295
- # corresponding snake_cased attributes.
296
- #
297
- # Cucumber::Messages::Rule.from_h(some_hash) # => #<Cucumber::Messages::Rule:0x... ...>
298
- #
299
-
300
- def self.from_h(hash)
301
- return nil if hash.nil?
302
-
303
- self.new(
304
- location: Location.from_h(hash[:location]),
305
- tags: hash[:tags]&.map { |item| Tag.from_h(item) },
306
- keyword: hash[:keyword],
307
- name: hash[:name],
308
- description: hash[:description],
309
- children: hash[:children]&.map { |item| RuleChild.from_h(item) },
310
- id: hash[:id],
311
- )
312
- end
313
- end
314
-
315
- class RuleChild
316
-
317
- ##
318
- # Returns a new RuleChild from the given hash.
319
- # If the hash keys are camelCased, they are properly assigned to the
320
- # corresponding snake_cased attributes.
321
- #
322
- # Cucumber::Messages::RuleChild.from_h(some_hash) # => #<Cucumber::Messages::RuleChild:0x... ...>
323
- #
324
-
325
- def self.from_h(hash)
326
- return nil if hash.nil?
327
-
328
- self.new(
329
- background: Background.from_h(hash[:background]),
330
- scenario: Scenario.from_h(hash[:scenario]),
331
- )
332
- end
333
- end
334
-
335
- class Scenario
336
-
337
- ##
338
- # Returns a new Scenario from the given hash.
339
- # If the hash keys are camelCased, they are properly assigned to the
340
- # corresponding snake_cased attributes.
341
- #
342
- # Cucumber::Messages::Scenario.from_h(some_hash) # => #<Cucumber::Messages::Scenario:0x... ...>
343
- #
344
-
345
- def self.from_h(hash)
346
- return nil if hash.nil?
347
-
348
- self.new(
349
- location: Location.from_h(hash[:location]),
350
- tags: hash[:tags]&.map { |item| Tag.from_h(item) },
351
- keyword: hash[:keyword],
352
- name: hash[:name],
353
- description: hash[:description],
354
- steps: hash[:steps]&.map { |item| Step.from_h(item) },
355
- examples: hash[:examples]&.map { |item| Examples.from_h(item) },
356
- id: hash[:id],
357
- )
358
- end
359
- end
360
-
361
- class Step
362
-
363
- ##
364
- # Returns a new Step from the given hash.
365
- # If the hash keys are camelCased, they are properly assigned to the
366
- # corresponding snake_cased attributes.
367
- #
368
- # Cucumber::Messages::Step.from_h(some_hash) # => #<Cucumber::Messages::Step:0x... ...>
369
- #
370
-
371
- def self.from_h(hash)
372
- return nil if hash.nil?
373
-
374
- self.new(
375
- location: Location.from_h(hash[:location]),
376
- keyword: hash[:keyword],
377
- keyword_type: hash[:keywordType],
378
- text: hash[:text],
379
- doc_string: DocString.from_h(hash[:docString]),
380
- data_table: DataTable.from_h(hash[:dataTable]),
381
- id: hash[:id],
382
- )
383
- end
384
- end
385
-
386
- class TableCell
387
-
388
- ##
389
- # Returns a new TableCell from the given hash.
390
- # If the hash keys are camelCased, they are properly assigned to the
391
- # corresponding snake_cased attributes.
392
- #
393
- # Cucumber::Messages::TableCell.from_h(some_hash) # => #<Cucumber::Messages::TableCell:0x... ...>
394
- #
395
-
396
- def self.from_h(hash)
397
- return nil if hash.nil?
398
-
399
- self.new(
400
- location: Location.from_h(hash[:location]),
401
- value: hash[:value],
402
- )
403
- end
404
- end
405
-
406
- class TableRow
407
-
408
- ##
409
- # Returns a new TableRow from the given hash.
410
- # If the hash keys are camelCased, they are properly assigned to the
411
- # corresponding snake_cased attributes.
412
- #
413
- # Cucumber::Messages::TableRow.from_h(some_hash) # => #<Cucumber::Messages::TableRow:0x... ...>
414
- #
415
-
416
- def self.from_h(hash)
417
- return nil if hash.nil?
418
-
419
- self.new(
420
- location: Location.from_h(hash[:location]),
421
- cells: hash[:cells]&.map { |item| TableCell.from_h(item) },
422
- id: hash[:id],
423
- )
424
- end
425
- end
426
-
427
- class Tag
428
-
429
- ##
430
- # Returns a new Tag from the given hash.
431
- # If the hash keys are camelCased, they are properly assigned to the
432
- # corresponding snake_cased attributes.
433
- #
434
- # Cucumber::Messages::Tag.from_h(some_hash) # => #<Cucumber::Messages::Tag:0x... ...>
435
- #
436
-
437
- def self.from_h(hash)
438
- return nil if hash.nil?
439
-
440
- self.new(
441
- location: Location.from_h(hash[:location]),
442
- name: hash[:name],
443
- id: hash[:id],
444
- )
445
- end
446
- end
447
-
448
- class Hook
449
-
450
- ##
451
- # Returns a new Hook from the given hash.
452
- # If the hash keys are camelCased, they are properly assigned to the
453
- # corresponding snake_cased attributes.
454
- #
455
- # Cucumber::Messages::Hook.from_h(some_hash) # => #<Cucumber::Messages::Hook:0x... ...>
456
- #
457
-
458
- def self.from_h(hash)
459
- return nil if hash.nil?
460
-
461
- self.new(
462
- id: hash[:id],
463
- name: hash[:name],
464
- source_reference: SourceReference.from_h(hash[:sourceReference]),
465
- tag_expression: hash[:tagExpression],
466
- )
467
- end
468
- end
469
-
470
- class Location
471
-
472
- ##
473
- # Returns a new Location from the given hash.
474
- # If the hash keys are camelCased, they are properly assigned to the
475
- # corresponding snake_cased attributes.
476
- #
477
- # Cucumber::Messages::Location.from_h(some_hash) # => #<Cucumber::Messages::Location:0x... ...>
478
- #
479
-
480
- def self.from_h(hash)
481
- return nil if hash.nil?
482
-
483
- self.new(
484
- line: hash[:line],
485
- column: hash[:column],
486
- )
487
- end
488
- end
489
-
490
- class Meta
491
-
492
- ##
493
- # Returns a new Meta from the given hash.
494
- # If the hash keys are camelCased, they are properly assigned to the
495
- # corresponding snake_cased attributes.
496
- #
497
- # Cucumber::Messages::Meta.from_h(some_hash) # => #<Cucumber::Messages::Meta:0x... ...>
498
- #
499
-
500
- def self.from_h(hash)
501
- return nil if hash.nil?
502
-
503
- self.new(
504
- protocol_version: hash[:protocolVersion],
505
- implementation: Product.from_h(hash[:implementation]),
506
- runtime: Product.from_h(hash[:runtime]),
507
- os: Product.from_h(hash[:os]),
508
- cpu: Product.from_h(hash[:cpu]),
509
- ci: Ci.from_h(hash[:ci]),
510
- )
511
- end
512
- end
513
-
514
- class Ci
515
-
516
- ##
517
- # Returns a new Ci from the given hash.
518
- # If the hash keys are camelCased, they are properly assigned to the
519
- # corresponding snake_cased attributes.
520
- #
521
- # Cucumber::Messages::Ci.from_h(some_hash) # => #<Cucumber::Messages::Ci:0x... ...>
522
- #
523
-
524
- def self.from_h(hash)
525
- return nil if hash.nil?
526
-
527
- self.new(
528
- name: hash[:name],
529
- url: hash[:url],
530
- build_number: hash[:buildNumber],
531
- git: Git.from_h(hash[:git]),
532
- )
533
- end
534
- end
535
-
536
- class Git
537
-
538
- ##
539
- # Returns a new Git from the given hash.
540
- # If the hash keys are camelCased, they are properly assigned to the
541
- # corresponding snake_cased attributes.
542
- #
543
- # Cucumber::Messages::Git.from_h(some_hash) # => #<Cucumber::Messages::Git:0x... ...>
544
- #
545
-
546
- def self.from_h(hash)
547
- return nil if hash.nil?
548
-
549
- self.new(
550
- remote: hash[:remote],
551
- revision: hash[:revision],
552
- branch: hash[:branch],
553
- tag: hash[:tag],
554
- )
555
- end
556
- end
557
-
558
- class Product
559
-
560
- ##
561
- # Returns a new Product from the given hash.
562
- # If the hash keys are camelCased, they are properly assigned to the
563
- # corresponding snake_cased attributes.
564
- #
565
- # Cucumber::Messages::Product.from_h(some_hash) # => #<Cucumber::Messages::Product:0x... ...>
566
- #
567
-
568
- def self.from_h(hash)
569
- return nil if hash.nil?
570
-
571
- self.new(
572
- name: hash[:name],
573
- version: hash[:version],
574
- )
575
- end
576
- end
577
-
578
- class ParameterType
579
-
580
- ##
581
- # Returns a new ParameterType from the given hash.
582
- # If the hash keys are camelCased, they are properly assigned to the
583
- # corresponding snake_cased attributes.
584
- #
585
- # Cucumber::Messages::ParameterType.from_h(some_hash) # => #<Cucumber::Messages::ParameterType:0x... ...>
586
- #
587
-
588
- def self.from_h(hash)
589
- return nil if hash.nil?
590
-
591
- self.new(
592
- name: hash[:name],
593
- regular_expressions: hash[:regularExpressions],
594
- prefer_for_regular_expression_match: hash[:preferForRegularExpressionMatch],
595
- use_for_snippets: hash[:useForSnippets],
596
- id: hash[:id],
597
- source_reference: SourceReference.from_h(hash[:sourceReference]),
598
- )
599
- end
600
- end
601
-
602
- class ParseError
603
-
604
- ##
605
- # Returns a new ParseError from the given hash.
606
- # If the hash keys are camelCased, they are properly assigned to the
607
- # corresponding snake_cased attributes.
608
- #
609
- # Cucumber::Messages::ParseError.from_h(some_hash) # => #<Cucumber::Messages::ParseError:0x... ...>
610
- #
611
-
612
- def self.from_h(hash)
613
- return nil if hash.nil?
614
-
615
- self.new(
616
- source: SourceReference.from_h(hash[:source]),
617
- message: hash[:message],
618
- )
619
- end
620
- end
621
-
622
- class Pickle
623
-
624
- ##
625
- # Returns a new Pickle from the given hash.
626
- # If the hash keys are camelCased, they are properly assigned to the
627
- # corresponding snake_cased attributes.
628
- #
629
- # Cucumber::Messages::Pickle.from_h(some_hash) # => #<Cucumber::Messages::Pickle:0x... ...>
630
- #
631
-
632
- def self.from_h(hash)
633
- return nil if hash.nil?
634
-
635
- self.new(
636
- id: hash[:id],
637
- uri: hash[:uri],
638
- name: hash[:name],
639
- language: hash[:language],
640
- steps: hash[:steps]&.map { |item| PickleStep.from_h(item) },
641
- tags: hash[:tags]&.map { |item| PickleTag.from_h(item) },
642
- ast_node_ids: hash[:astNodeIds],
643
- )
644
- end
645
- end
646
-
647
- class PickleDocString
648
-
649
- ##
650
- # Returns a new PickleDocString from the given hash.
651
- # If the hash keys are camelCased, they are properly assigned to the
652
- # corresponding snake_cased attributes.
653
- #
654
- # Cucumber::Messages::PickleDocString.from_h(some_hash) # => #<Cucumber::Messages::PickleDocString:0x... ...>
655
- #
656
-
657
- def self.from_h(hash)
658
- return nil if hash.nil?
659
-
660
- self.new(
661
- media_type: hash[:mediaType],
662
- content: hash[:content],
663
- )
664
- end
665
- end
666
-
667
- class PickleStep
668
-
669
- ##
670
- # Returns a new PickleStep from the given hash.
671
- # If the hash keys are camelCased, they are properly assigned to the
672
- # corresponding snake_cased attributes.
673
- #
674
- # Cucumber::Messages::PickleStep.from_h(some_hash) # => #<Cucumber::Messages::PickleStep:0x... ...>
675
- #
676
-
677
- def self.from_h(hash)
678
- return nil if hash.nil?
679
-
680
- self.new(
681
- argument: PickleStepArgument.from_h(hash[:argument]),
682
- ast_node_ids: hash[:astNodeIds],
683
- id: hash[:id],
684
- type: hash[:type],
685
- text: hash[:text],
686
- )
687
- end
688
- end
689
-
690
- class PickleStepArgument
691
-
692
- ##
693
- # Returns a new PickleStepArgument from the given hash.
694
- # If the hash keys are camelCased, they are properly assigned to the
695
- # corresponding snake_cased attributes.
696
- #
697
- # Cucumber::Messages::PickleStepArgument.from_h(some_hash) # => #<Cucumber::Messages::PickleStepArgument:0x... ...>
698
- #
699
-
700
- def self.from_h(hash)
701
- return nil if hash.nil?
702
-
703
- self.new(
704
- doc_string: PickleDocString.from_h(hash[:docString]),
705
- data_table: PickleTable.from_h(hash[:dataTable]),
706
- )
707
- end
708
- end
709
-
710
- class PickleTable
711
-
712
- ##
713
- # Returns a new PickleTable from the given hash.
714
- # If the hash keys are camelCased, they are properly assigned to the
715
- # corresponding snake_cased attributes.
716
- #
717
- # Cucumber::Messages::PickleTable.from_h(some_hash) # => #<Cucumber::Messages::PickleTable:0x... ...>
718
- #
719
-
720
- def self.from_h(hash)
721
- return nil if hash.nil?
722
-
723
- self.new(
724
- rows: hash[:rows]&.map { |item| PickleTableRow.from_h(item) },
725
- )
726
- end
727
- end
728
-
729
- class PickleTableCell
730
-
731
- ##
732
- # Returns a new PickleTableCell from the given hash.
733
- # If the hash keys are camelCased, they are properly assigned to the
734
- # corresponding snake_cased attributes.
735
- #
736
- # Cucumber::Messages::PickleTableCell.from_h(some_hash) # => #<Cucumber::Messages::PickleTableCell:0x... ...>
737
- #
738
-
739
- def self.from_h(hash)
740
- return nil if hash.nil?
741
-
742
- self.new(
743
- value: hash[:value],
744
- )
745
- end
746
- end
747
-
748
- class PickleTableRow
749
-
750
- ##
751
- # Returns a new PickleTableRow from the given hash.
752
- # If the hash keys are camelCased, they are properly assigned to the
753
- # corresponding snake_cased attributes.
754
- #
755
- # Cucumber::Messages::PickleTableRow.from_h(some_hash) # => #<Cucumber::Messages::PickleTableRow:0x... ...>
756
- #
757
-
758
- def self.from_h(hash)
759
- return nil if hash.nil?
760
-
761
- self.new(
762
- cells: hash[:cells]&.map { |item| PickleTableCell.from_h(item) },
763
- )
764
- end
765
- end
766
-
767
- class PickleTag
768
-
769
- ##
770
- # Returns a new PickleTag from the given hash.
771
- # If the hash keys are camelCased, they are properly assigned to the
772
- # corresponding snake_cased attributes.
773
- #
774
- # Cucumber::Messages::PickleTag.from_h(some_hash) # => #<Cucumber::Messages::PickleTag:0x... ...>
775
- #
776
-
777
- def self.from_h(hash)
778
- return nil if hash.nil?
779
-
780
- self.new(
781
- name: hash[:name],
782
- ast_node_id: hash[:astNodeId],
783
- )
784
- end
785
- end
786
-
787
- class Source
788
-
789
- ##
790
- # Returns a new Source from the given hash.
791
- # If the hash keys are camelCased, they are properly assigned to the
792
- # corresponding snake_cased attributes.
793
- #
794
- # Cucumber::Messages::Source.from_h(some_hash) # => #<Cucumber::Messages::Source:0x... ...>
795
- #
796
-
797
- def self.from_h(hash)
798
- return nil if hash.nil?
799
-
800
- self.new(
801
- uri: hash[:uri],
802
- data: hash[:data],
803
- media_type: hash[:mediaType],
804
- )
805
- end
806
- end
807
-
808
- class SourceReference
809
-
810
- ##
811
- # Returns a new SourceReference from the given hash.
812
- # If the hash keys are camelCased, they are properly assigned to the
813
- # corresponding snake_cased attributes.
814
- #
815
- # Cucumber::Messages::SourceReference.from_h(some_hash) # => #<Cucumber::Messages::SourceReference:0x... ...>
816
- #
817
-
818
- def self.from_h(hash)
819
- return nil if hash.nil?
820
-
821
- self.new(
822
- uri: hash[:uri],
823
- java_method: JavaMethod.from_h(hash[:javaMethod]),
824
- java_stack_trace_element: JavaStackTraceElement.from_h(hash[:javaStackTraceElement]),
825
- location: Location.from_h(hash[:location]),
826
- )
827
- end
828
- end
829
-
830
- class JavaMethod
831
-
832
- ##
833
- # Returns a new JavaMethod from the given hash.
834
- # If the hash keys are camelCased, they are properly assigned to the
835
- # corresponding snake_cased attributes.
836
- #
837
- # Cucumber::Messages::JavaMethod.from_h(some_hash) # => #<Cucumber::Messages::JavaMethod:0x... ...>
838
- #
839
-
840
- def self.from_h(hash)
841
- return nil if hash.nil?
842
-
843
- self.new(
844
- class_name: hash[:className],
845
- method_name: hash[:methodName],
846
- method_parameter_types: hash[:methodParameterTypes],
847
- )
848
- end
849
- end
850
-
851
- class JavaStackTraceElement
852
-
853
- ##
854
- # Returns a new JavaStackTraceElement from the given hash.
855
- # If the hash keys are camelCased, they are properly assigned to the
856
- # corresponding snake_cased attributes.
857
- #
858
- # Cucumber::Messages::JavaStackTraceElement.from_h(some_hash) # => #<Cucumber::Messages::JavaStackTraceElement:0x... ...>
859
- #
860
-
861
- def self.from_h(hash)
862
- return nil if hash.nil?
863
-
864
- self.new(
865
- class_name: hash[:className],
866
- file_name: hash[:fileName],
867
- method_name: hash[:methodName],
868
- )
869
- end
870
- end
871
-
872
- class StepDefinition
873
-
874
- ##
875
- # Returns a new StepDefinition from the given hash.
876
- # If the hash keys are camelCased, they are properly assigned to the
877
- # corresponding snake_cased attributes.
878
- #
879
- # Cucumber::Messages::StepDefinition.from_h(some_hash) # => #<Cucumber::Messages::StepDefinition:0x... ...>
880
- #
881
-
882
- def self.from_h(hash)
883
- return nil if hash.nil?
884
-
885
- self.new(
886
- id: hash[:id],
887
- pattern: StepDefinitionPattern.from_h(hash[:pattern]),
888
- source_reference: SourceReference.from_h(hash[:sourceReference]),
889
- )
890
- end
891
- end
892
-
893
- class StepDefinitionPattern
894
-
895
- ##
896
- # Returns a new StepDefinitionPattern from the given hash.
897
- # If the hash keys are camelCased, they are properly assigned to the
898
- # corresponding snake_cased attributes.
899
- #
900
- # Cucumber::Messages::StepDefinitionPattern.from_h(some_hash) # => #<Cucumber::Messages::StepDefinitionPattern:0x... ...>
901
- #
902
-
903
- def self.from_h(hash)
904
- return nil if hash.nil?
905
-
906
- self.new(
907
- source: hash[:source],
908
- type: hash[:type],
909
- )
910
- end
911
- end
912
-
913
- class TestCase
914
-
915
- ##
916
- # Returns a new TestCase from the given hash.
917
- # If the hash keys are camelCased, they are properly assigned to the
918
- # corresponding snake_cased attributes.
919
- #
920
- # Cucumber::Messages::TestCase.from_h(some_hash) # => #<Cucumber::Messages::TestCase:0x... ...>
921
- #
922
-
923
- def self.from_h(hash)
924
- return nil if hash.nil?
925
-
926
- self.new(
927
- id: hash[:id],
928
- pickle_id: hash[:pickleId],
929
- test_steps: hash[:testSteps]&.map { |item| TestStep.from_h(item) },
930
- )
931
- end
932
- end
933
-
934
- class Group
935
-
936
- ##
937
- # Returns a new Group from the given hash.
938
- # If the hash keys are camelCased, they are properly assigned to the
939
- # corresponding snake_cased attributes.
940
- #
941
- # Cucumber::Messages::Group.from_h(some_hash) # => #<Cucumber::Messages::Group:0x... ...>
942
- #
943
-
944
- def self.from_h(hash)
945
- return nil if hash.nil?
946
-
947
- self.new(
948
- children: hash[:children]&.map { |item| Group.from_h(item) },
949
- start: hash[:start],
950
- value: hash[:value],
951
- )
952
- end
953
- end
954
-
955
- class StepMatchArgument
956
-
957
- ##
958
- # Returns a new StepMatchArgument from the given hash.
959
- # If the hash keys are camelCased, they are properly assigned to the
960
- # corresponding snake_cased attributes.
961
- #
962
- # Cucumber::Messages::StepMatchArgument.from_h(some_hash) # => #<Cucumber::Messages::StepMatchArgument:0x... ...>
963
- #
964
-
965
- def self.from_h(hash)
966
- return nil if hash.nil?
967
-
968
- self.new(
969
- group: Group.from_h(hash[:group]),
970
- parameter_type_name: hash[:parameterTypeName],
971
- )
972
- end
973
- end
974
-
975
- class StepMatchArgumentsList
976
-
977
- ##
978
- # Returns a new StepMatchArgumentsList from the given hash.
979
- # If the hash keys are camelCased, they are properly assigned to the
980
- # corresponding snake_cased attributes.
981
- #
982
- # Cucumber::Messages::StepMatchArgumentsList.from_h(some_hash) # => #<Cucumber::Messages::StepMatchArgumentsList:0x... ...>
983
- #
984
-
985
- def self.from_h(hash)
986
- return nil if hash.nil?
987
-
988
- self.new(
989
- step_match_arguments: hash[:stepMatchArguments]&.map { |item| StepMatchArgument.from_h(item) },
990
- )
991
- end
992
- end
993
-
994
- class TestStep
995
-
996
- ##
997
- # Returns a new TestStep from the given hash.
998
- # If the hash keys are camelCased, they are properly assigned to the
999
- # corresponding snake_cased attributes.
1000
- #
1001
- # Cucumber::Messages::TestStep.from_h(some_hash) # => #<Cucumber::Messages::TestStep:0x... ...>
1002
- #
1003
-
1004
- def self.from_h(hash)
1005
- return nil if hash.nil?
1006
-
1007
- self.new(
1008
- hook_id: hash[:hookId],
1009
- id: hash[:id],
1010
- pickle_step_id: hash[:pickleStepId],
1011
- step_definition_ids: hash[:stepDefinitionIds],
1012
- step_match_arguments_lists: hash[:stepMatchArgumentsLists]&.map { |item| StepMatchArgumentsList.from_h(item) },
1013
- )
1014
- end
1015
- end
1016
-
1017
- class TestCaseFinished
1018
-
1019
- ##
1020
- # Returns a new TestCaseFinished from the given hash.
1021
- # If the hash keys are camelCased, they are properly assigned to the
1022
- # corresponding snake_cased attributes.
1023
- #
1024
- # Cucumber::Messages::TestCaseFinished.from_h(some_hash) # => #<Cucumber::Messages::TestCaseFinished:0x... ...>
1025
- #
1026
-
1027
- def self.from_h(hash)
1028
- return nil if hash.nil?
1029
-
1030
- self.new(
1031
- test_case_started_id: hash[:testCaseStartedId],
1032
- timestamp: Timestamp.from_h(hash[:timestamp]),
1033
- will_be_retried: hash[:willBeRetried],
1034
- )
1035
- end
1036
- end
1037
-
1038
- class TestCaseStarted
1039
-
1040
- ##
1041
- # Returns a new TestCaseStarted from the given hash.
1042
- # If the hash keys are camelCased, they are properly assigned to the
1043
- # corresponding snake_cased attributes.
1044
- #
1045
- # Cucumber::Messages::TestCaseStarted.from_h(some_hash) # => #<Cucumber::Messages::TestCaseStarted:0x... ...>
1046
- #
1047
-
1048
- def self.from_h(hash)
1049
- return nil if hash.nil?
1050
-
1051
- self.new(
1052
- attempt: hash[:attempt],
1053
- id: hash[:id],
1054
- test_case_id: hash[:testCaseId],
1055
- worker_id: hash[:workerId],
1056
- timestamp: Timestamp.from_h(hash[:timestamp]),
1057
- )
1058
- end
1059
- end
1060
-
1061
- class TestRunFinished
1062
-
1063
- ##
1064
- # Returns a new TestRunFinished from the given hash.
1065
- # If the hash keys are camelCased, they are properly assigned to the
1066
- # corresponding snake_cased attributes.
1067
- #
1068
- # Cucumber::Messages::TestRunFinished.from_h(some_hash) # => #<Cucumber::Messages::TestRunFinished:0x... ...>
1069
- #
1070
-
1071
- def self.from_h(hash)
1072
- return nil if hash.nil?
1073
-
1074
- self.new(
1075
- message: hash[:message],
1076
- success: hash[:success],
1077
- timestamp: Timestamp.from_h(hash[:timestamp]),
1078
- exception: Exception.from_h(hash[:exception]),
1079
- )
1080
- end
1081
- end
1082
-
1083
- class TestRunStarted
1084
-
1085
- ##
1086
- # Returns a new TestRunStarted from the given hash.
1087
- # If the hash keys are camelCased, they are properly assigned to the
1088
- # corresponding snake_cased attributes.
1089
- #
1090
- # Cucumber::Messages::TestRunStarted.from_h(some_hash) # => #<Cucumber::Messages::TestRunStarted:0x... ...>
1091
- #
1092
-
1093
- def self.from_h(hash)
1094
- return nil if hash.nil?
1095
-
1096
- self.new(
1097
- timestamp: Timestamp.from_h(hash[:timestamp]),
1098
- )
1099
- end
1100
- end
1101
-
1102
- class TestStepFinished
1103
-
1104
- ##
1105
- # Returns a new TestStepFinished from the given hash.
1106
- # If the hash keys are camelCased, they are properly assigned to the
1107
- # corresponding snake_cased attributes.
1108
- #
1109
- # Cucumber::Messages::TestStepFinished.from_h(some_hash) # => #<Cucumber::Messages::TestStepFinished:0x... ...>
1110
- #
1111
-
1112
- def self.from_h(hash)
1113
- return nil if hash.nil?
1114
-
1115
- self.new(
1116
- test_case_started_id: hash[:testCaseStartedId],
1117
- test_step_id: hash[:testStepId],
1118
- test_step_result: TestStepResult.from_h(hash[:testStepResult]),
1119
- timestamp: Timestamp.from_h(hash[:timestamp]),
1120
- )
1121
- end
1122
- end
1123
-
1124
- class TestStepResult
1125
-
1126
- ##
1127
- # Returns a new TestStepResult from the given hash.
1128
- # If the hash keys are camelCased, they are properly assigned to the
1129
- # corresponding snake_cased attributes.
1130
- #
1131
- # Cucumber::Messages::TestStepResult.from_h(some_hash) # => #<Cucumber::Messages::TestStepResult:0x... ...>
1132
- #
1133
-
1134
- def self.from_h(hash)
1135
- return nil if hash.nil?
1136
-
1137
- self.new(
1138
- duration: Duration.from_h(hash[:duration]),
1139
- message: hash[:message],
1140
- status: hash[:status],
1141
- exception: Exception.from_h(hash[:exception]),
1142
- )
1143
- end
1144
- end
1145
-
1146
- class TestStepStarted
1147
-
1148
- ##
1149
- # Returns a new TestStepStarted from the given hash.
1150
- # If the hash keys are camelCased, they are properly assigned to the
1151
- # corresponding snake_cased attributes.
1152
- #
1153
- # Cucumber::Messages::TestStepStarted.from_h(some_hash) # => #<Cucumber::Messages::TestStepStarted:0x... ...>
1154
- #
1155
-
1156
- def self.from_h(hash)
1157
- return nil if hash.nil?
1158
-
1159
- self.new(
1160
- test_case_started_id: hash[:testCaseStartedId],
1161
- test_step_id: hash[:testStepId],
1162
- timestamp: Timestamp.from_h(hash[:timestamp]),
1163
- )
1164
- end
1165
- end
1166
-
1167
- class Timestamp
1168
-
1169
- ##
1170
- # Returns a new Timestamp from the given hash.
1171
- # If the hash keys are camelCased, they are properly assigned to the
1172
- # corresponding snake_cased attributes.
1173
- #
1174
- # Cucumber::Messages::Timestamp.from_h(some_hash) # => #<Cucumber::Messages::Timestamp:0x... ...>
1175
- #
1176
-
1177
- def self.from_h(hash)
1178
- return nil if hash.nil?
1179
-
1180
- self.new(
1181
- seconds: hash[:seconds],
1182
- nanos: hash[:nanos],
1183
- )
1184
- end
1185
- end
1186
-
1187
- class UndefinedParameterType
1188
-
1189
- ##
1190
- # Returns a new UndefinedParameterType from the given hash.
1191
- # If the hash keys are camelCased, they are properly assigned to the
1192
- # corresponding snake_cased attributes.
1193
- #
1194
- # Cucumber::Messages::UndefinedParameterType.from_h(some_hash) # => #<Cucumber::Messages::UndefinedParameterType:0x... ...>
1195
- #
1196
-
1197
- def self.from_h(hash)
1198
- return nil if hash.nil?
1199
-
1200
- self.new(
1201
- expression: hash[:expression],
1202
- name: hash[:name],
1203
- )
1204
- end
1205
- end
1206
- end
1207
- end