cucumber-messages 24.1.0 → 25.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/cucumber/messages/attachment.rb +126 -0
  4. data/lib/cucumber/messages/attachment_content_encoding.rb +11 -0
  5. data/lib/cucumber/messages/background.rb +64 -0
  6. data/lib/cucumber/messages/ci.rb +62 -0
  7. data/lib/cucumber/messages/comment.rb +50 -0
  8. data/lib/cucumber/messages/data_table.rb +41 -0
  9. data/lib/cucumber/messages/doc_string.rb +51 -0
  10. data/lib/cucumber/messages/duration.rb +50 -0
  11. data/lib/cucumber/messages/envelope.rb +124 -0
  12. data/lib/cucumber/messages/examples.rb +74 -0
  13. data/lib/cucumber/messages/exception.rb +57 -0
  14. data/lib/cucumber/messages/feature.rb +87 -0
  15. data/lib/cucumber/messages/feature_child.rb +49 -0
  16. data/lib/cucumber/messages/gherkin_document.rb +62 -0
  17. data/lib/cucumber/messages/git.rb +54 -0
  18. data/lib/cucumber/messages/group.rb +46 -0
  19. data/lib/cucumber/messages/helpers/id_generator/incrementing.rb +20 -0
  20. data/lib/cucumber/messages/helpers/id_generator/uuid.rb +17 -0
  21. data/lib/cucumber/messages/helpers/id_generator.rb +4 -0
  22. data/lib/cucumber/messages/helpers/ndjson_to_message_enumerator.rb +30 -0
  23. data/lib/cucumber/messages/helpers/time_conversion.rb +31 -0
  24. data/lib/cucumber/messages/hook.rb +51 -0
  25. data/lib/cucumber/messages/java_method.rb +46 -0
  26. data/lib/cucumber/messages/java_stack_trace_element.rb +46 -0
  27. data/lib/cucumber/messages/location.rb +44 -0
  28. data/lib/cucumber/messages/message.rb +92 -4
  29. data/lib/cucumber/messages/meta.rb +81 -0
  30. data/lib/cucumber/messages/parameter_type.rb +64 -0
  31. data/lib/cucumber/messages/parse_error.rb +41 -0
  32. data/lib/cucumber/messages/pickle.rb +107 -0
  33. data/lib/cucumber/messages/pickle_doc_string.rb +41 -0
  34. data/lib/cucumber/messages/pickle_step.rb +71 -0
  35. data/lib/cucumber/messages/pickle_step_argument.rb +43 -0
  36. data/lib/cucumber/messages/pickle_step_type.rb +13 -0
  37. data/lib/cucumber/messages/pickle_table.rb +36 -0
  38. data/lib/cucumber/messages/pickle_table_cell.rb +36 -0
  39. data/lib/cucumber/messages/pickle_table_row.rb +36 -0
  40. data/lib/cucumber/messages/pickle_tag.rb +47 -0
  41. data/lib/cucumber/messages/product.rb +49 -0
  42. data/lib/cucumber/messages/rule.rb +72 -0
  43. data/lib/cucumber/messages/rule_child.rb +44 -0
  44. data/lib/cucumber/messages/scenario.rb +74 -0
  45. data/lib/cucumber/messages/source.rb +63 -0
  46. data/lib/cucumber/messages/source_media_type.rb +11 -0
  47. data/lib/cucumber/messages/source_reference.rb +55 -0
  48. data/lib/cucumber/messages/step.rb +80 -0
  49. data/lib/cucumber/messages/step_definition.rb +46 -0
  50. data/lib/cucumber/messages/step_definition_pattern.rb +41 -0
  51. data/lib/cucumber/messages/step_definition_pattern_type.rb +11 -0
  52. data/lib/cucumber/messages/step_keyword_type.rb +14 -0
  53. data/lib/cucumber/messages/step_match_argument.rb +54 -0
  54. data/lib/cucumber/messages/step_match_arguments_list.rb +36 -0
  55. data/lib/cucumber/messages/table_cell.rb +49 -0
  56. data/lib/cucumber/messages/table_row.rb +54 -0
  57. data/lib/cucumber/messages/tag.rb +58 -0
  58. data/lib/cucumber/messages/test_case.rb +54 -0
  59. data/lib/cucumber/messages/test_case_finished.rb +46 -0
  60. data/lib/cucumber/messages/test_case_started.rb +69 -0
  61. data/lib/cucumber/messages/test_run_finished.rb +63 -0
  62. data/lib/cucumber/messages/test_run_started.rb +36 -0
  63. data/lib/cucumber/messages/test_step.rb +74 -0
  64. data/lib/cucumber/messages/test_step_finished.rb +51 -0
  65. data/lib/cucumber/messages/test_step_result.rb +57 -0
  66. data/lib/cucumber/messages/test_step_result_status.rb +16 -0
  67. data/lib/cucumber/messages/test_step_started.rb +46 -0
  68. data/lib/cucumber/messages/timestamp.rb +52 -0
  69. data/lib/cucumber/messages/undefined_parameter_type.rb +41 -0
  70. data/lib/cucumber/messages.rb +9 -5
  71. metadata +110 -30
  72. data/lib/cucumber/messages/id_generator.rb +0 -24
  73. data/lib/cucumber/messages/message/deserialization.rb +0 -37
  74. data/lib/cucumber/messages/message/serialization.rb +0 -70
  75. data/lib/cucumber/messages/message/utils.rb +0 -45
  76. data/lib/cucumber/messages/ndjson_to_message_enumerator.rb +0 -21
  77. data/lib/cucumber/messages/time_conversion.rb +0 -33
  78. data/lib/cucumber/messages.deserializers.rb +0 -1208
  79. data/lib/cucumber/messages.dtos.rb +0 -1782
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the PickleTag message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ #
10
+ # *
11
+ # A tag
12
+ ##
13
+ class PickleTag < Message
14
+ attr_reader :name
15
+
16
+ ##
17
+ # Points to the AST node this was created from
18
+ ##
19
+ attr_reader :ast_node_id
20
+
21
+ def initialize(
22
+ name: '',
23
+ ast_node_id: ''
24
+ )
25
+ @name = name
26
+ @ast_node_id = ast_node_id
27
+ super()
28
+ end
29
+
30
+ ##
31
+ # Returns a new PickleTag from the given hash.
32
+ # If the hash keys are camelCased, they are properly assigned to the
33
+ # corresponding snake_cased attributes.
34
+ #
35
+ # Cucumber::Messages::PickleTag.from_h(some_hash) # => #<Cucumber::Messages::PickleTag:0x... ...>
36
+ ##
37
+ def self.from_h(hash)
38
+ return nil if hash.nil?
39
+
40
+ new(
41
+ name: hash[:name],
42
+ ast_node_id: hash[:astNodeId]
43
+ )
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the Product message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ #
10
+ # Used to describe various properties of Meta
11
+ ##
12
+ class Product < Message
13
+ ##
14
+ # The product name
15
+ ##
16
+ attr_reader :name
17
+
18
+ ##
19
+ # The product version
20
+ ##
21
+ attr_reader :version
22
+
23
+ def initialize(
24
+ name: '',
25
+ version: nil
26
+ )
27
+ @name = name
28
+ @version = version
29
+ super()
30
+ end
31
+
32
+ ##
33
+ # Returns a new Product 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::Product.from_h(some_hash) # => #<Cucumber::Messages::Product:0x... ...>
38
+ ##
39
+ def self.from_h(hash)
40
+ return nil if hash.nil?
41
+
42
+ new(
43
+ name: hash[:name],
44
+ version: hash[:version]
45
+ )
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the Rule message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ ##
10
+ class Rule < Message
11
+ ##
12
+ # The location of the `Rule` keyword
13
+ ##
14
+ attr_reader :location
15
+
16
+ ##
17
+ # All the tags placed above the `Rule` keyword
18
+ ##
19
+ attr_reader :tags
20
+
21
+ attr_reader :keyword
22
+
23
+ attr_reader :name
24
+
25
+ attr_reader :description
26
+
27
+ attr_reader :children
28
+
29
+ attr_reader :id
30
+
31
+ def initialize(
32
+ location: Location.new,
33
+ tags: [],
34
+ keyword: '',
35
+ name: '',
36
+ description: '',
37
+ children: [],
38
+ id: ''
39
+ )
40
+ @location = location
41
+ @tags = tags
42
+ @keyword = keyword
43
+ @name = name
44
+ @description = description
45
+ @children = children
46
+ @id = id
47
+ super()
48
+ end
49
+
50
+ ##
51
+ # Returns a new Rule from the given hash.
52
+ # If the hash keys are camelCased, they are properly assigned to the
53
+ # corresponding snake_cased attributes.
54
+ #
55
+ # Cucumber::Messages::Rule.from_h(some_hash) # => #<Cucumber::Messages::Rule:0x... ...>
56
+ ##
57
+ def self.from_h(hash)
58
+ return nil if hash.nil?
59
+
60
+ new(
61
+ location: Location.from_h(hash[:location]),
62
+ tags: hash[:tags]&.map { |item| Tag.from_h(item) },
63
+ keyword: hash[:keyword],
64
+ name: hash[:name],
65
+ description: hash[:description],
66
+ children: hash[:children]&.map { |item| RuleChild.from_h(item) },
67
+ id: hash[:id]
68
+ )
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the RuleChild message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ #
10
+ # *
11
+ # A child node of a `Rule` node
12
+ ##
13
+ class RuleChild < Message
14
+ attr_reader :background
15
+
16
+ attr_reader :scenario
17
+
18
+ def initialize(
19
+ background: nil,
20
+ scenario: nil
21
+ )
22
+ @background = background
23
+ @scenario = scenario
24
+ super()
25
+ end
26
+
27
+ ##
28
+ # Returns a new RuleChild from the given hash.
29
+ # If the hash keys are camelCased, they are properly assigned to the
30
+ # corresponding snake_cased attributes.
31
+ #
32
+ # Cucumber::Messages::RuleChild.from_h(some_hash) # => #<Cucumber::Messages::RuleChild:0x... ...>
33
+ ##
34
+ def self.from_h(hash)
35
+ return nil if hash.nil?
36
+
37
+ new(
38
+ background: Background.from_h(hash[:background]),
39
+ scenario: Scenario.from_h(hash[:scenario])
40
+ )
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the Scenario message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ ##
10
+ class Scenario < Message
11
+ ##
12
+ # The location of the `Scenario` keyword
13
+ ##
14
+ attr_reader :location
15
+
16
+ attr_reader :tags
17
+
18
+ attr_reader :keyword
19
+
20
+ attr_reader :name
21
+
22
+ attr_reader :description
23
+
24
+ attr_reader :steps
25
+
26
+ attr_reader :examples
27
+
28
+ attr_reader :id
29
+
30
+ def initialize(
31
+ location: Location.new,
32
+ tags: [],
33
+ keyword: '',
34
+ name: '',
35
+ description: '',
36
+ steps: [],
37
+ examples: [],
38
+ id: ''
39
+ )
40
+ @location = location
41
+ @tags = tags
42
+ @keyword = keyword
43
+ @name = name
44
+ @description = description
45
+ @steps = steps
46
+ @examples = examples
47
+ @id = id
48
+ super()
49
+ end
50
+
51
+ ##
52
+ # Returns a new Scenario from the given hash.
53
+ # If the hash keys are camelCased, they are properly assigned to the
54
+ # corresponding snake_cased attributes.
55
+ #
56
+ # Cucumber::Messages::Scenario.from_h(some_hash) # => #<Cucumber::Messages::Scenario:0x... ...>
57
+ ##
58
+ def self.from_h(hash)
59
+ return nil if hash.nil?
60
+
61
+ new(
62
+ location: Location.from_h(hash[:location]),
63
+ tags: hash[:tags]&.map { |item| Tag.from_h(item) },
64
+ keyword: hash[:keyword],
65
+ name: hash[:name],
66
+ description: hash[:description],
67
+ steps: hash[:steps]&.map { |item| Step.from_h(item) },
68
+ examples: hash[:examples]&.map { |item| Examples.from_h(item) },
69
+ id: hash[:id]
70
+ )
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the Source message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ #
10
+ # //// Source
11
+ #
12
+ # *
13
+ # A source file, typically a Gherkin document or Java/Ruby/JavaScript source code
14
+ ##
15
+ class Source < Message
16
+ ##
17
+ # *
18
+ # The [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier)
19
+ # of the source, typically a file path relative to the root directory
20
+ ##
21
+ attr_reader :uri
22
+
23
+ ##
24
+ # The contents of the file
25
+ ##
26
+ attr_reader :data
27
+
28
+ ##
29
+ # The media type of the file. Can be used to specify custom types, such as
30
+ # text/x.cucumber.gherkin+plain
31
+ ##
32
+ attr_reader :media_type
33
+
34
+ def initialize(
35
+ uri: '',
36
+ data: '',
37
+ media_type: SourceMediaType::TEXT_X_CUCUMBER_GHERKIN_PLAIN
38
+ )
39
+ @uri = uri
40
+ @data = data
41
+ @media_type = media_type
42
+ super()
43
+ end
44
+
45
+ ##
46
+ # Returns a new Source from the given hash.
47
+ # If the hash keys are camelCased, they are properly assigned to the
48
+ # corresponding snake_cased attributes.
49
+ #
50
+ # Cucumber::Messages::Source.from_h(some_hash) # => #<Cucumber::Messages::Source:0x... ...>
51
+ ##
52
+ def self.from_h(hash)
53
+ return nil if hash.nil?
54
+
55
+ new(
56
+ uri: hash[:uri],
57
+ data: hash[:data],
58
+ media_type: hash[:mediaType]
59
+ )
60
+ end
61
+ end
62
+ end
63
+ 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/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ class SourceMediaType
7
+ TEXT_X_CUCUMBER_GHERKIN_PLAIN = 'text/x.cucumber.gherkin+plain'
8
+ TEXT_X_CUCUMBER_GHERKIN_MARKDOWN = 'text/x.cucumber.gherkin+markdown'
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the SourceReference message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ #
10
+ # *
11
+ # Points to a [Source](#io.cucumber.messages.Source) identified by `uri` and a
12
+ # [Location](#io.cucumber.messages.Location) within that file.
13
+ ##
14
+ class SourceReference < Message
15
+ attr_reader :uri
16
+
17
+ attr_reader :java_method
18
+
19
+ attr_reader :java_stack_trace_element
20
+
21
+ attr_reader :location
22
+
23
+ def initialize(
24
+ uri: nil,
25
+ java_method: nil,
26
+ java_stack_trace_element: nil,
27
+ location: nil
28
+ )
29
+ @uri = uri
30
+ @java_method = java_method
31
+ @java_stack_trace_element = java_stack_trace_element
32
+ @location = location
33
+ super()
34
+ end
35
+
36
+ ##
37
+ # Returns a new SourceReference from the given hash.
38
+ # If the hash keys are camelCased, they are properly assigned to the
39
+ # corresponding snake_cased attributes.
40
+ #
41
+ # Cucumber::Messages::SourceReference.from_h(some_hash) # => #<Cucumber::Messages::SourceReference:0x... ...>
42
+ ##
43
+ def self.from_h(hash)
44
+ return nil if hash.nil?
45
+
46
+ new(
47
+ uri: hash[:uri],
48
+ java_method: JavaMethod.from_h(hash[:javaMethod]),
49
+ java_stack_trace_element: JavaStackTraceElement.from_h(hash[:javaStackTraceElement]),
50
+ location: Location.from_h(hash[:location])
51
+ )
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the Step message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ #
10
+ # A step
11
+ ##
12
+ class Step < Message
13
+ ##
14
+ # The location of the steps' `keyword`
15
+ ##
16
+ attr_reader :location
17
+
18
+ ##
19
+ # The actual keyword as it appeared in the source.
20
+ ##
21
+ attr_reader :keyword
22
+
23
+ ##
24
+ # The test phase signalled by the keyword: Context definition (Given), Action performance (When), Outcome assertion (Then). Other keywords signal Continuation (And and But) from a prior keyword. Please note that all translations which a dialect maps to multiple keywords (`*` is in this category for all dialects), map to 'Unknown'.
25
+ ##
26
+ attr_reader :keyword_type
27
+
28
+ attr_reader :text
29
+
30
+ attr_reader :doc_string
31
+
32
+ attr_reader :data_table
33
+
34
+ ##
35
+ # Unique ID to be able to reference the Step from PickleStep
36
+ ##
37
+ attr_reader :id
38
+
39
+ def initialize(
40
+ location: Location.new,
41
+ keyword: '',
42
+ keyword_type: nil,
43
+ text: '',
44
+ doc_string: nil,
45
+ data_table: nil,
46
+ id: ''
47
+ )
48
+ @location = location
49
+ @keyword = keyword
50
+ @keyword_type = keyword_type
51
+ @text = text
52
+ @doc_string = doc_string
53
+ @data_table = data_table
54
+ @id = id
55
+ super()
56
+ end
57
+
58
+ ##
59
+ # Returns a new Step 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::Step.from_h(some_hash) # => #<Cucumber::Messages::Step:0x... ...>
64
+ ##
65
+ def self.from_h(hash)
66
+ return nil if hash.nil?
67
+
68
+ new(
69
+ location: Location.from_h(hash[:location]),
70
+ keyword: hash[:keyword],
71
+ keyword_type: hash[:keywordType],
72
+ text: hash[:text],
73
+ doc_string: DocString.from_h(hash[:docString]),
74
+ data_table: DataTable.from_h(hash[:dataTable]),
75
+ id: hash[:id]
76
+ )
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the StepDefinition message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ ##
10
+ class StepDefinition < Message
11
+ attr_reader :id
12
+
13
+ attr_reader :pattern
14
+
15
+ attr_reader :source_reference
16
+
17
+ def initialize(
18
+ id: '',
19
+ pattern: StepDefinitionPattern.new,
20
+ source_reference: SourceReference.new
21
+ )
22
+ @id = id
23
+ @pattern = pattern
24
+ @source_reference = source_reference
25
+ super()
26
+ end
27
+
28
+ ##
29
+ # Returns a new StepDefinition from the given hash.
30
+ # If the hash keys are camelCased, they are properly assigned to the
31
+ # corresponding snake_cased attributes.
32
+ #
33
+ # Cucumber::Messages::StepDefinition.from_h(some_hash) # => #<Cucumber::Messages::StepDefinition:0x... ...>
34
+ ##
35
+ def self.from_h(hash)
36
+ return nil if hash.nil?
37
+
38
+ new(
39
+ id: hash[:id],
40
+ pattern: StepDefinitionPattern.from_h(hash[:pattern]),
41
+ source_reference: SourceReference.from_h(hash[:sourceReference])
42
+ )
43
+ end
44
+ end
45
+ end
46
+ 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/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the StepDefinitionPattern message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ ##
10
+ class StepDefinitionPattern < Message
11
+ attr_reader :source
12
+
13
+ attr_reader :type
14
+
15
+ def initialize(
16
+ source: '',
17
+ type: StepDefinitionPatternType::CUCUMBER_EXPRESSION
18
+ )
19
+ @source = source
20
+ @type = type
21
+ super()
22
+ end
23
+
24
+ ##
25
+ # Returns a new StepDefinitionPattern 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::StepDefinitionPattern.from_h(some_hash) # => #<Cucumber::Messages::StepDefinitionPattern:0x... ...>
30
+ ##
31
+ def self.from_h(hash)
32
+ return nil if hash.nil?
33
+
34
+ new(
35
+ source: hash[:source],
36
+ type: hash[:type]
37
+ )
38
+ end
39
+ end
40
+ end
41
+ 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/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ class StepDefinitionPatternType
7
+ CUCUMBER_EXPRESSION = 'CUCUMBER_EXPRESSION'
8
+ REGULAR_EXPRESSION = 'REGULAR_EXPRESSION'
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ class StepKeywordType
7
+ UNKNOWN = 'Unknown'
8
+ CONTEXT = 'Context'
9
+ ACTION = 'Action'
10
+ OUTCOME = 'Outcome'
11
+ CONJUNCTION = 'Conjunction'
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/jsonschema/scripts/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the StepMatchArgument message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ #
10
+ # *
11
+ # Represents a single argument extracted from a step match and passed to a step definition.
12
+ # This is used for the following purposes:
13
+ # - Construct an argument to pass to a step definition (possibly through a parameter type transform)
14
+ # - Highlight the matched parameter in rich formatters such as the HTML formatter
15
+ #
16
+ # This message closely matches the `Argument` class in the `cucumber-expressions` library.
17
+ ##
18
+ class StepMatchArgument < Message
19
+ ##
20
+ # *
21
+ # Represents the outermost capture group of an argument. This message closely matches the
22
+ # `Group` class in the `cucumber-expressions` library.
23
+ ##
24
+ attr_reader :group
25
+
26
+ attr_reader :parameter_type_name
27
+
28
+ def initialize(
29
+ group: Group.new,
30
+ parameter_type_name: nil
31
+ )
32
+ @group = group
33
+ @parameter_type_name = parameter_type_name
34
+ super()
35
+ end
36
+
37
+ ##
38
+ # Returns a new StepMatchArgument from the given hash.
39
+ # If the hash keys are camelCased, they are properly assigned to the
40
+ # corresponding snake_cased attributes.
41
+ #
42
+ # Cucumber::Messages::StepMatchArgument.from_h(some_hash) # => #<Cucumber::Messages::StepMatchArgument:0x... ...>
43
+ ##
44
+ def self.from_h(hash)
45
+ return nil if hash.nil?
46
+
47
+ new(
48
+ group: Group.from_h(hash[:group]),
49
+ parameter_type_name: hash[:parameterTypeName]
50
+ )
51
+ end
52
+ end
53
+ end
54
+ end