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.
- checksums.yaml +4 -4
- data/LICENSE +2 -2
- data/README.md +1 -0
- data/VERSION +1 -1
- data/lib/cucumber/messages/attachment.rb +131 -0
- data/lib/cucumber/messages/attachment_content_encoding.rb +11 -0
- data/lib/cucumber/messages/background.rb +64 -0
- data/lib/cucumber/messages/ci.rb +62 -0
- data/lib/cucumber/messages/comment.rb +50 -0
- data/lib/cucumber/messages/data_table.rb +41 -0
- data/lib/cucumber/messages/doc_string.rb +51 -0
- data/lib/cucumber/messages/duration.rb +50 -0
- data/lib/cucumber/messages/envelope.rb +134 -0
- data/lib/cucumber/messages/examples.rb +74 -0
- data/lib/cucumber/messages/exception.rb +57 -0
- data/lib/cucumber/messages/feature.rb +87 -0
- data/lib/cucumber/messages/feature_child.rb +49 -0
- data/lib/cucumber/messages/gherkin_document.rb +62 -0
- data/lib/cucumber/messages/git.rb +54 -0
- data/lib/cucumber/messages/group.rb +46 -0
- data/lib/cucumber/messages/helpers/id_generator/incrementing.rb +20 -0
- data/lib/cucumber/messages/helpers/id_generator/uuid.rb +17 -0
- data/lib/cucumber/messages/helpers/id_generator.rb +4 -0
- data/lib/cucumber/messages/helpers/ndjson_to_message_enumerator.rb +30 -0
- data/lib/cucumber/messages/helpers/time_conversion.rb +31 -0
- data/lib/cucumber/messages/hook.rb +56 -0
- data/lib/cucumber/messages/hook_type.rb +15 -0
- data/lib/cucumber/messages/java_method.rb +46 -0
- data/lib/cucumber/messages/java_stack_trace_element.rb +46 -0
- data/lib/cucumber/messages/location.rb +44 -0
- data/lib/cucumber/messages/message.rb +93 -5
- data/lib/cucumber/messages/meta.rb +81 -0
- data/lib/cucumber/messages/parameter_type.rb +64 -0
- data/lib/cucumber/messages/parse_error.rb +41 -0
- data/lib/cucumber/messages/pickle.rb +107 -0
- data/lib/cucumber/messages/pickle_doc_string.rb +41 -0
- data/lib/cucumber/messages/pickle_step.rb +71 -0
- data/lib/cucumber/messages/pickle_step_argument.rb +43 -0
- data/lib/cucumber/messages/pickle_step_type.rb +13 -0
- data/lib/cucumber/messages/pickle_table.rb +36 -0
- data/lib/cucumber/messages/pickle_table_cell.rb +36 -0
- data/lib/cucumber/messages/pickle_table_row.rb +36 -0
- data/lib/cucumber/messages/pickle_tag.rb +47 -0
- data/lib/cucumber/messages/product.rb +49 -0
- data/lib/cucumber/messages/rule.rb +72 -0
- data/lib/cucumber/messages/rule_child.rb +44 -0
- data/lib/cucumber/messages/scenario.rb +74 -0
- data/lib/cucumber/messages/source.rb +63 -0
- data/lib/cucumber/messages/source_media_type.rb +11 -0
- data/lib/cucumber/messages/source_reference.rb +55 -0
- data/lib/cucumber/messages/step.rb +80 -0
- data/lib/cucumber/messages/step_definition.rb +46 -0
- data/lib/cucumber/messages/step_definition_pattern.rb +41 -0
- data/lib/cucumber/messages/step_definition_pattern_type.rb +11 -0
- data/lib/cucumber/messages/step_keyword_type.rb +14 -0
- data/lib/cucumber/messages/step_match_argument.rb +54 -0
- data/lib/cucumber/messages/step_match_arguments_list.rb +36 -0
- data/lib/cucumber/messages/table_cell.rb +49 -0
- data/lib/cucumber/messages/table_row.rb +54 -0
- data/lib/cucumber/messages/tag.rb +58 -0
- data/lib/cucumber/messages/test_case.rb +62 -0
- data/lib/cucumber/messages/test_case_finished.rb +46 -0
- data/lib/cucumber/messages/test_case_started.rb +69 -0
- data/lib/cucumber/messages/test_run_finished.rb +68 -0
- data/lib/cucumber/messages/test_run_hook_finished.rb +49 -0
- data/lib/cucumber/messages/test_run_hook_started.rb +60 -0
- data/lib/cucumber/messages/test_run_started.rb +41 -0
- data/lib/cucumber/messages/test_step.rb +74 -0
- data/lib/cucumber/messages/test_step_finished.rb +51 -0
- data/lib/cucumber/messages/test_step_result.rb +57 -0
- data/lib/cucumber/messages/test_step_result_status.rb +16 -0
- data/lib/cucumber/messages/test_step_started.rb +46 -0
- data/lib/cucumber/messages/timestamp.rb +52 -0
- data/lib/cucumber/messages/undefined_parameter_type.rb +41 -0
- data/lib/cucumber/messages.rb +9 -5
- metadata +140 -61
- data/lib/cucumber/messages/id_generator.rb +0 -24
- data/lib/cucumber/messages/message/deserialization.rb +0 -39
- data/lib/cucumber/messages/message/serialization.rb +0 -73
- data/lib/cucumber/messages/message/utils.rb +0 -46
- data/lib/cucumber/messages/ndjson_to_message_enumerator.rb +0 -21
- data/lib/cucumber/messages/time_conversion.rb +0 -33
- data/lib/cucumber/messages.deserializers.rb +0 -1207
- data/lib/cucumber/messages.dtos.rb +0 -2000
- data/spec/capture_warnings.rb +0 -74
- data/spec/cucumber/messages/acceptance_spec.rb +0 -33
- data/spec/cucumber/messages/id_generator_spec.rb +0 -29
- data/spec/cucumber/messages/message/deserialization_spec.rb +0 -30
- data/spec/cucumber/messages/message/dummy_messages.rb +0 -38
- data/spec/cucumber/messages/message/serialization_spec.rb +0 -89
- data/spec/cucumber/messages/message/utils_spec.rb +0 -30
- data/spec/cucumber/messages/ndjson_serialization_spec.rb +0 -56
- data/spec/cucumber/messages/time_conversion_spec.rb +0 -41
- data/spec/cucumber/messages/version_spec.rb +0 -11
@@ -0,0 +1,36 @@
|
|
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 PickleTableCell message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
|
8
|
+
##
|
9
|
+
##
|
10
|
+
class PickleTableCell < Message
|
11
|
+
attr_reader :value
|
12
|
+
|
13
|
+
def initialize(
|
14
|
+
value: ''
|
15
|
+
)
|
16
|
+
@value = value
|
17
|
+
super()
|
18
|
+
end
|
19
|
+
|
20
|
+
##
|
21
|
+
# Returns a new PickleTableCell from the given hash.
|
22
|
+
# If the hash keys are camelCased, they are properly assigned to the
|
23
|
+
# corresponding snake_cased attributes.
|
24
|
+
#
|
25
|
+
# Cucumber::Messages::PickleTableCell.from_h(some_hash) # => #<Cucumber::Messages::PickleTableCell:0x... ...>
|
26
|
+
##
|
27
|
+
def self.from_h(hash)
|
28
|
+
return nil if hash.nil?
|
29
|
+
|
30
|
+
new(
|
31
|
+
value: hash[:value]
|
32
|
+
)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
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 PickleTableRow message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
|
8
|
+
##
|
9
|
+
##
|
10
|
+
class PickleTableRow < Message
|
11
|
+
attr_reader :cells
|
12
|
+
|
13
|
+
def initialize(
|
14
|
+
cells: []
|
15
|
+
)
|
16
|
+
@cells = cells
|
17
|
+
super()
|
18
|
+
end
|
19
|
+
|
20
|
+
##
|
21
|
+
# Returns a new PickleTableRow from the given hash.
|
22
|
+
# If the hash keys are camelCased, they are properly assigned to the
|
23
|
+
# corresponding snake_cased attributes.
|
24
|
+
#
|
25
|
+
# Cucumber::Messages::PickleTableRow.from_h(some_hash) # => #<Cucumber::Messages::PickleTableRow:0x... ...>
|
26
|
+
##
|
27
|
+
def self.from_h(hash)
|
28
|
+
return nil if hash.nil?
|
29
|
+
|
30
|
+
new(
|
31
|
+
cells: hash[:cells]&.map { |item| PickleTableCell.from_h(item) }
|
32
|
+
)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -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/codegen/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/codegen/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/codegen/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/codegen/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/codegen/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/codegen/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/codegen/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/codegen/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/codegen/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/codegen/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/codegen/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/codegen/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/codegen/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
|