cucumber-cucumber-expressions 10.2.0 → 11.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rsync +1 -0
- data/VERSION +1 -1
- data/cucumber-cucumber-expressions.gemspec +2 -2
- data/default.mk +12 -0
- data/examples.txt +13 -1
- data/lib/cucumber/cucumber_expressions/ast.rb +201 -0
- data/lib/cucumber/cucumber_expressions/cucumber_expression.rb +80 -76
- data/lib/cucumber/cucumber_expressions/cucumber_expression_generator.rb +4 -8
- data/lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb +219 -0
- data/lib/cucumber/cucumber_expressions/cucumber_expression_tokenizer.rb +95 -0
- data/lib/cucumber/cucumber_expressions/errors.rb +175 -4
- data/lib/cucumber/cucumber_expressions/group.rb +1 -1
- data/lib/cucumber/cucumber_expressions/parameter_type.rb +12 -7
- data/lib/cucumber/cucumber_expressions/parameter_type_matcher.rb +2 -2
- data/lib/cucumber/cucumber_expressions/parameter_type_registry.rb +1 -1
- data/lib/cucumber/cucumber_expressions/tree_regexp.rb +53 -46
- data/spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb +24 -0
- data/spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb +73 -124
- data/spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb +24 -0
- data/spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb +1 -1
- data/spec/cucumber/cucumber_expressions/expression_examples_spec.rb +1 -1
- data/spec/cucumber/cucumber_expressions/expression_factory_spec.rb +0 -4
- data/spec/cucumber/cucumber_expressions/tree_regexp_spec.rb +58 -5
- data/testdata/ast/alternation-followed-by-optional.yaml +17 -0
- data/testdata/ast/alternation-phrase.yaml +16 -0
- data/testdata/ast/alternation-with-parameter.yaml +27 -0
- data/testdata/ast/alternation-with-unused-end-optional.yaml +15 -0
- data/testdata/ast/alternation-with-unused-start-optional.yaml +8 -0
- data/testdata/ast/alternation-with-white-space.yaml +12 -0
- data/testdata/ast/alternation.yaml +12 -0
- data/testdata/ast/anonymous-parameter.yaml +5 -0
- data/testdata/ast/closing-brace.yaml +5 -0
- data/testdata/ast/closing-parenthesis.yaml +5 -0
- data/testdata/ast/empty-alternation.yaml +8 -0
- data/testdata/ast/empty-alternations.yaml +9 -0
- data/testdata/ast/empty-string.yaml +3 -0
- data/testdata/ast/escaped-alternation.yaml +5 -0
- data/testdata/ast/escaped-backslash.yaml +5 -0
- data/testdata/ast/escaped-opening-parenthesis.yaml +5 -0
- data/testdata/ast/escaped-optional-followed-by-optional.yaml +15 -0
- data/testdata/ast/escaped-optional-phrase.yaml +10 -0
- data/testdata/ast/escaped-optional.yaml +7 -0
- data/testdata/ast/opening-brace.yaml +8 -0
- data/testdata/ast/opening-parenthesis.yaml +8 -0
- data/testdata/ast/optional-containing-nested-optional.yaml +15 -0
- data/testdata/ast/optional-phrase.yaml +12 -0
- data/testdata/ast/optional.yaml +7 -0
- data/testdata/ast/parameter.yaml +7 -0
- data/testdata/ast/phrase.yaml +9 -0
- data/testdata/ast/unfinished-parameter.yaml +8 -0
- data/testdata/expression/allows-escaped-optional-parameter-types.yaml +4 -0
- data/testdata/expression/allows-parameter-type-in-alternation-1.yaml +4 -0
- data/testdata/expression/allows-parameter-type-in-alternation-2.yaml +4 -0
- data/testdata/expression/does-allow-parameter-adjacent-to-alternation.yaml +5 -0
- data/testdata/expression/does-not-allow-alternation-in-optional.yaml +9 -0
- data/testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-left-parameter.yaml +10 -0
- data/testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-optional.yaml +9 -0
- data/testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-right-parameter.yaml +9 -0
- data/testdata/expression/does-not-allow-alternation-with-empty-alternative.yaml +9 -0
- data/testdata/expression/does-not-allow-empty-optional.yaml +9 -0
- data/testdata/expression/does-not-allow-nested-optional.yaml +8 -0
- data/testdata/expression/does-not-allow-optional-parameter-types.yaml +9 -0
- data/testdata/expression/does-not-allow-parameter-name-with-reserved-characters.yaml +10 -0
- data/testdata/expression/does-not-allow-unfinished-parenthesis-1.yaml +8 -0
- data/testdata/expression/does-not-allow-unfinished-parenthesis-2.yaml +8 -0
- data/testdata/expression/does-not-allow-unfinished-parenthesis-3.yaml +8 -0
- data/testdata/expression/does-not-match-misquoted-string.yaml +4 -0
- data/testdata/expression/doesnt-match-float-as-int.yaml +5 -0
- data/testdata/expression/matches-alternation.yaml +4 -0
- data/testdata/expression/matches-anonymous-parameter-type.yaml +5 -0
- data/testdata/expression/matches-double-quoted-empty-string-as-empty-string-along-with-other-strings.yaml +4 -0
- data/testdata/expression/matches-double-quoted-empty-string-as-empty-string.yaml +4 -0
- data/testdata/expression/matches-double-quoted-string-with-escaped-double-quote.yaml +4 -0
- data/testdata/expression/matches-double-quoted-string-with-single-quotes.yaml +4 -0
- data/testdata/expression/matches-double-quoted-string.yaml +4 -0
- data/testdata/expression/matches-doubly-escaped-parenthesis.yaml +4 -0
- data/testdata/expression/matches-doubly-escaped-slash-1.yaml +4 -0
- data/testdata/expression/matches-doubly-escaped-slash-2.yaml +4 -0
- data/testdata/expression/matches-escaped-parenthesis-1.yaml +4 -0
- data/testdata/expression/matches-escaped-parenthesis-2.yaml +4 -0
- data/testdata/expression/matches-escaped-parenthesis-3.yaml +4 -0
- data/testdata/expression/matches-escaped-slash.yaml +4 -0
- data/testdata/expression/matches-float-1.yaml +5 -0
- data/testdata/expression/matches-float-2.yaml +5 -0
- data/testdata/expression/matches-int.yaml +5 -0
- data/testdata/expression/matches-multiple-double-quoted-strings.yaml +4 -0
- data/testdata/expression/matches-multiple-single-quoted-strings.yaml +4 -0
- data/testdata/expression/matches-optional-before-alternation-1.yaml +4 -0
- data/testdata/expression/matches-optional-before-alternation-2.yaml +4 -0
- data/testdata/expression/matches-optional-before-alternation-with-regex-characters-1.yaml +4 -0
- data/testdata/expression/matches-optional-before-alternation-with-regex-characters-2.yaml +4 -0
- data/testdata/expression/matches-optional-in-alternation-1.yaml +5 -0
- data/testdata/expression/matches-optional-in-alternation-2.yaml +5 -0
- data/testdata/expression/matches-optional-in-alternation-3.yaml +5 -0
- data/testdata/expression/matches-single-quoted-empty-string-as-empty-string-along-with-other-strings.yaml +4 -0
- data/testdata/expression/matches-single-quoted-empty-string-as-empty-string.yaml +4 -0
- data/testdata/expression/matches-single-quoted-string-with-double-quotes.yaml +4 -0
- data/testdata/expression/matches-single-quoted-string-with-escaped-single-quote.yaml +4 -0
- data/testdata/expression/matches-single-quoted-string.yaml +4 -0
- data/testdata/expression/matches-word.yaml +4 -0
- data/testdata/expression/throws-unknown-parameter-type.yaml +10 -0
- data/testdata/regex/alternation-with-optional.yaml +2 -0
- data/testdata/regex/alternation.yaml +2 -0
- data/testdata/regex/empty.yaml +2 -0
- data/testdata/regex/escape-regex-characters.yaml +2 -0
- data/testdata/regex/optional.yaml +2 -0
- data/testdata/regex/parameter.yaml +2 -0
- data/testdata/regex/text.yaml +2 -0
- data/testdata/regex/unicode.yaml +2 -0
- data/testdata/tokens/alternation-phrase.yaml +13 -0
- data/testdata/tokens/alternation.yaml +9 -0
- data/testdata/tokens/empty-string.yaml +6 -0
- data/testdata/tokens/escape-non-reserved-character.yaml +8 -0
- data/testdata/tokens/escaped-alternation.yaml +9 -0
- data/testdata/tokens/escaped-char-has-start-index-of-text-token.yaml +9 -0
- data/testdata/tokens/escaped-end-of-line.yaml +8 -0
- data/testdata/tokens/escaped-optional.yaml +7 -0
- data/testdata/tokens/escaped-parameter.yaml +7 -0
- data/testdata/tokens/escaped-space.yaml +7 -0
- data/testdata/tokens/optional-phrase.yaml +13 -0
- data/testdata/tokens/optional.yaml +9 -0
- data/testdata/tokens/parameter-phrase.yaml +13 -0
- data/testdata/tokens/parameter.yaml +9 -0
- data/testdata/tokens/phrase.yaml +11 -0
- metadata +118 -13
- data/spec/cucumber/cucumber_expressions/cucumber_expression_regexp_spec.rb +0 -57
@@ -0,0 +1,9 @@
|
|
1
|
+
expression: blind/cripple
|
2
|
+
expected: |-
|
3
|
+
[
|
4
|
+
{"type": "START_OF_LINE", "start": 0, "end": 0, "text": ""},
|
5
|
+
{"type": "TEXT", "start": 0, "end": 5, "text": "blind"},
|
6
|
+
{"type": "ALTERNATION", "start": 5, "end": 6, "text": "/"},
|
7
|
+
{"type": "TEXT", "start": 6, "end": 13, "text": "cripple"},
|
8
|
+
{"type": "END_OF_LINE", "start": 13, "end": 13, "text": ""}
|
9
|
+
]
|
@@ -0,0 +1,9 @@
|
|
1
|
+
expression: blind\ and\ famished\/cripple mice
|
2
|
+
expected: |-
|
3
|
+
[
|
4
|
+
{"type": "START_OF_LINE", "start": 0, "end": 0, "text": ""},
|
5
|
+
{"type": "TEXT", "start": 0, "end": 29, "text": "blind and famished/cripple"},
|
6
|
+
{"type": "WHITE_SPACE", "start": 29, "end": 30, "text": " "},
|
7
|
+
{"type": "TEXT", "start": 30, "end": 34, "text": "mice"},
|
8
|
+
{"type": "END_OF_LINE", "start": 34, "end": 34, "text": ""}
|
9
|
+
]
|
@@ -0,0 +1,9 @@
|
|
1
|
+
expression: ' \/ '
|
2
|
+
expected: |-
|
3
|
+
[
|
4
|
+
{"type": "START_OF_LINE", "start": 0, "end": 0, "text": ""},
|
5
|
+
{"type": "WHITE_SPACE", "start": 0, "end": 1, "text": " "},
|
6
|
+
{"type": "TEXT", "start": 1, "end": 3, "text": "/"},
|
7
|
+
{"type": "WHITE_SPACE", "start": 3, "end": 4, "text": " "},
|
8
|
+
{"type": "END_OF_LINE", "start": 4, "end": 4, "text": ""}
|
9
|
+
]
|
@@ -0,0 +1,13 @@
|
|
1
|
+
expression: three (blind) mice
|
2
|
+
expected: |-
|
3
|
+
[
|
4
|
+
{"type": "START_OF_LINE", "start": 0, "end": 0, "text": ""},
|
5
|
+
{"type": "TEXT", "start": 0, "end": 5, "text": "three"},
|
6
|
+
{"type": "WHITE_SPACE", "start": 5, "end": 6, "text": " "},
|
7
|
+
{"type": "BEGIN_OPTIONAL", "start": 6, "end": 7, "text": "("},
|
8
|
+
{"type": "TEXT", "start": 7, "end": 12, "text": "blind"},
|
9
|
+
{"type": "END_OPTIONAL", "start": 12, "end": 13, "text": ")"},
|
10
|
+
{"type": "WHITE_SPACE", "start": 13, "end": 14, "text": " "},
|
11
|
+
{"type": "TEXT", "start": 14, "end": 18, "text": "mice"},
|
12
|
+
{"type": "END_OF_LINE", "start": 18, "end": 18, "text": ""}
|
13
|
+
]
|
@@ -0,0 +1,9 @@
|
|
1
|
+
expression: (blind)
|
2
|
+
expected: |-
|
3
|
+
[
|
4
|
+
{"type": "START_OF_LINE", "start": 0, "end": 0, "text": ""},
|
5
|
+
{"type": "BEGIN_OPTIONAL", "start": 0, "end": 1, "text": "("},
|
6
|
+
{"type": "TEXT", "start": 1, "end": 6, "text": "blind"},
|
7
|
+
{"type": "END_OPTIONAL", "start": 6, "end": 7, "text": ")"},
|
8
|
+
{"type": "END_OF_LINE", "start": 7, "end": 7, "text": ""}
|
9
|
+
]
|
@@ -0,0 +1,13 @@
|
|
1
|
+
expression: three {string} mice
|
2
|
+
expected: |-
|
3
|
+
[
|
4
|
+
{"type": "START_OF_LINE", "start": 0, "end": 0, "text": ""},
|
5
|
+
{"type": "TEXT", "start": 0, "end": 5, "text": "three"},
|
6
|
+
{"type": "WHITE_SPACE", "start": 5, "end": 6, "text": " "},
|
7
|
+
{"type": "BEGIN_PARAMETER", "start": 6, "end": 7, "text": "{"},
|
8
|
+
{"type": "TEXT", "start": 7, "end": 13, "text": "string"},
|
9
|
+
{"type": "END_PARAMETER", "start": 13, "end": 14, "text": "}"},
|
10
|
+
{"type": "WHITE_SPACE", "start": 14, "end": 15, "text": " "},
|
11
|
+
{"type": "TEXT", "start": 15, "end": 19, "text": "mice"},
|
12
|
+
{"type": "END_OF_LINE", "start": 19, "end": 19, "text": ""}
|
13
|
+
]
|
@@ -0,0 +1,9 @@
|
|
1
|
+
expression: "{string}"
|
2
|
+
expected: |-
|
3
|
+
[
|
4
|
+
{"type": "START_OF_LINE", "start": 0, "end": 0, "text": ""},
|
5
|
+
{"type": "BEGIN_PARAMETER", "start": 0, "end": 1, "text": "{"},
|
6
|
+
{"type": "TEXT", "start": 1, "end": 7, "text": "string"},
|
7
|
+
{"type": "END_PARAMETER", "start": 7, "end": 8, "text": "}"},
|
8
|
+
{"type": "END_OF_LINE", "start": 8, "end": 8, "text": ""}
|
9
|
+
]
|
@@ -0,0 +1,11 @@
|
|
1
|
+
expression: three blind mice
|
2
|
+
expected: |-
|
3
|
+
[
|
4
|
+
{"type": "START_OF_LINE", "start": 0, "end": 0, "text": ""},
|
5
|
+
{"type": "TEXT", "start": 0, "end": 5, "text": "three"},
|
6
|
+
{"type": "WHITE_SPACE", "start": 5, "end": 6, "text": " "},
|
7
|
+
{"type": "TEXT", "start": 6, "end": 11, "text": "blind"},
|
8
|
+
{"type": "WHITE_SPACE", "start": 11, "end": 12, "text": " "},
|
9
|
+
{"type": "TEXT", "start": 12, "end": 16, "text": "mice"},
|
10
|
+
{"type": "END_OF_LINE", "start": 16, "end": 16, "text": ""}
|
11
|
+
]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-cucumber-expressions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 11.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aslak Hellesøy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '13.0'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 13.0.
|
22
|
+
version: 13.0.3
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,27 +29,27 @@ dependencies:
|
|
29
29
|
version: '13.0'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 13.0.
|
32
|
+
version: 13.0.3
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rspec
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '3.
|
39
|
+
version: '3.10'
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 3.
|
42
|
+
version: 3.10.0
|
43
43
|
type: :development
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '3.
|
49
|
+
version: '3.10'
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 3.
|
52
|
+
version: 3.10.0
|
53
53
|
description: Cucumber Expressions - a simpler alternative to Regular Expressions
|
54
54
|
email: cukes@googlegroups.com
|
55
55
|
executables: []
|
@@ -71,9 +71,12 @@ files:
|
|
71
71
|
- default.mk
|
72
72
|
- examples.txt
|
73
73
|
- lib/cucumber/cucumber_expressions/argument.rb
|
74
|
+
- lib/cucumber/cucumber_expressions/ast.rb
|
74
75
|
- lib/cucumber/cucumber_expressions/combinatorial_generated_expression_factory.rb
|
75
76
|
- lib/cucumber/cucumber_expressions/cucumber_expression.rb
|
76
77
|
- lib/cucumber/cucumber_expressions/cucumber_expression_generator.rb
|
78
|
+
- lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb
|
79
|
+
- lib/cucumber/cucumber_expressions/cucumber_expression_tokenizer.rb
|
77
80
|
- lib/cucumber/cucumber_expressions/errors.rb
|
78
81
|
- lib/cucumber/cucumber_expressions/expression_factory.rb
|
79
82
|
- lib/cucumber/cucumber_expressions/generated_expression.rb
|
@@ -89,8 +92,9 @@ files:
|
|
89
92
|
- spec/cucumber/cucumber_expressions/argument_spec.rb
|
90
93
|
- spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_test.rb
|
91
94
|
- spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb
|
92
|
-
- spec/cucumber/cucumber_expressions/
|
95
|
+
- spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb
|
93
96
|
- spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb
|
97
|
+
- spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
|
94
98
|
- spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb
|
95
99
|
- spec/cucumber/cucumber_expressions/expression_examples_spec.rb
|
96
100
|
- spec/cucumber/cucumber_expressions/expression_factory_spec.rb
|
@@ -98,6 +102,107 @@ files:
|
|
98
102
|
- spec/cucumber/cucumber_expressions/parameter_type_spec.rb
|
99
103
|
- spec/cucumber/cucumber_expressions/regular_expression_spec.rb
|
100
104
|
- spec/cucumber/cucumber_expressions/tree_regexp_spec.rb
|
105
|
+
- testdata/ast/alternation-followed-by-optional.yaml
|
106
|
+
- testdata/ast/alternation-phrase.yaml
|
107
|
+
- testdata/ast/alternation-with-parameter.yaml
|
108
|
+
- testdata/ast/alternation-with-unused-end-optional.yaml
|
109
|
+
- testdata/ast/alternation-with-unused-start-optional.yaml
|
110
|
+
- testdata/ast/alternation-with-white-space.yaml
|
111
|
+
- testdata/ast/alternation.yaml
|
112
|
+
- testdata/ast/anonymous-parameter.yaml
|
113
|
+
- testdata/ast/closing-brace.yaml
|
114
|
+
- testdata/ast/closing-parenthesis.yaml
|
115
|
+
- testdata/ast/empty-alternation.yaml
|
116
|
+
- testdata/ast/empty-alternations.yaml
|
117
|
+
- testdata/ast/empty-string.yaml
|
118
|
+
- testdata/ast/escaped-alternation.yaml
|
119
|
+
- testdata/ast/escaped-backslash.yaml
|
120
|
+
- testdata/ast/escaped-opening-parenthesis.yaml
|
121
|
+
- testdata/ast/escaped-optional-followed-by-optional.yaml
|
122
|
+
- testdata/ast/escaped-optional-phrase.yaml
|
123
|
+
- testdata/ast/escaped-optional.yaml
|
124
|
+
- testdata/ast/opening-brace.yaml
|
125
|
+
- testdata/ast/opening-parenthesis.yaml
|
126
|
+
- testdata/ast/optional-containing-nested-optional.yaml
|
127
|
+
- testdata/ast/optional-phrase.yaml
|
128
|
+
- testdata/ast/optional.yaml
|
129
|
+
- testdata/ast/parameter.yaml
|
130
|
+
- testdata/ast/phrase.yaml
|
131
|
+
- testdata/ast/unfinished-parameter.yaml
|
132
|
+
- testdata/expression/allows-escaped-optional-parameter-types.yaml
|
133
|
+
- testdata/expression/allows-parameter-type-in-alternation-1.yaml
|
134
|
+
- testdata/expression/allows-parameter-type-in-alternation-2.yaml
|
135
|
+
- testdata/expression/does-allow-parameter-adjacent-to-alternation.yaml
|
136
|
+
- testdata/expression/does-not-allow-alternation-in-optional.yaml
|
137
|
+
- testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-left-parameter.yaml
|
138
|
+
- testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-optional.yaml
|
139
|
+
- testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-right-parameter.yaml
|
140
|
+
- testdata/expression/does-not-allow-alternation-with-empty-alternative.yaml
|
141
|
+
- testdata/expression/does-not-allow-empty-optional.yaml
|
142
|
+
- testdata/expression/does-not-allow-nested-optional.yaml
|
143
|
+
- testdata/expression/does-not-allow-optional-parameter-types.yaml
|
144
|
+
- testdata/expression/does-not-allow-parameter-name-with-reserved-characters.yaml
|
145
|
+
- testdata/expression/does-not-allow-unfinished-parenthesis-1.yaml
|
146
|
+
- testdata/expression/does-not-allow-unfinished-parenthesis-2.yaml
|
147
|
+
- testdata/expression/does-not-allow-unfinished-parenthesis-3.yaml
|
148
|
+
- testdata/expression/does-not-match-misquoted-string.yaml
|
149
|
+
- testdata/expression/doesnt-match-float-as-int.yaml
|
150
|
+
- testdata/expression/matches-alternation.yaml
|
151
|
+
- testdata/expression/matches-anonymous-parameter-type.yaml
|
152
|
+
- testdata/expression/matches-double-quoted-empty-string-as-empty-string-along-with-other-strings.yaml
|
153
|
+
- testdata/expression/matches-double-quoted-empty-string-as-empty-string.yaml
|
154
|
+
- testdata/expression/matches-double-quoted-string-with-escaped-double-quote.yaml
|
155
|
+
- testdata/expression/matches-double-quoted-string-with-single-quotes.yaml
|
156
|
+
- testdata/expression/matches-double-quoted-string.yaml
|
157
|
+
- testdata/expression/matches-doubly-escaped-parenthesis.yaml
|
158
|
+
- testdata/expression/matches-doubly-escaped-slash-1.yaml
|
159
|
+
- testdata/expression/matches-doubly-escaped-slash-2.yaml
|
160
|
+
- testdata/expression/matches-escaped-parenthesis-1.yaml
|
161
|
+
- testdata/expression/matches-escaped-parenthesis-2.yaml
|
162
|
+
- testdata/expression/matches-escaped-parenthesis-3.yaml
|
163
|
+
- testdata/expression/matches-escaped-slash.yaml
|
164
|
+
- testdata/expression/matches-float-1.yaml
|
165
|
+
- testdata/expression/matches-float-2.yaml
|
166
|
+
- testdata/expression/matches-int.yaml
|
167
|
+
- testdata/expression/matches-multiple-double-quoted-strings.yaml
|
168
|
+
- testdata/expression/matches-multiple-single-quoted-strings.yaml
|
169
|
+
- testdata/expression/matches-optional-before-alternation-1.yaml
|
170
|
+
- testdata/expression/matches-optional-before-alternation-2.yaml
|
171
|
+
- testdata/expression/matches-optional-before-alternation-with-regex-characters-1.yaml
|
172
|
+
- testdata/expression/matches-optional-before-alternation-with-regex-characters-2.yaml
|
173
|
+
- testdata/expression/matches-optional-in-alternation-1.yaml
|
174
|
+
- testdata/expression/matches-optional-in-alternation-2.yaml
|
175
|
+
- testdata/expression/matches-optional-in-alternation-3.yaml
|
176
|
+
- testdata/expression/matches-single-quoted-empty-string-as-empty-string-along-with-other-strings.yaml
|
177
|
+
- testdata/expression/matches-single-quoted-empty-string-as-empty-string.yaml
|
178
|
+
- testdata/expression/matches-single-quoted-string-with-double-quotes.yaml
|
179
|
+
- testdata/expression/matches-single-quoted-string-with-escaped-single-quote.yaml
|
180
|
+
- testdata/expression/matches-single-quoted-string.yaml
|
181
|
+
- testdata/expression/matches-word.yaml
|
182
|
+
- testdata/expression/throws-unknown-parameter-type.yaml
|
183
|
+
- testdata/regex/alternation-with-optional.yaml
|
184
|
+
- testdata/regex/alternation.yaml
|
185
|
+
- testdata/regex/empty.yaml
|
186
|
+
- testdata/regex/escape-regex-characters.yaml
|
187
|
+
- testdata/regex/optional.yaml
|
188
|
+
- testdata/regex/parameter.yaml
|
189
|
+
- testdata/regex/text.yaml
|
190
|
+
- testdata/regex/unicode.yaml
|
191
|
+
- testdata/tokens/alternation-phrase.yaml
|
192
|
+
- testdata/tokens/alternation.yaml
|
193
|
+
- testdata/tokens/empty-string.yaml
|
194
|
+
- testdata/tokens/escape-non-reserved-character.yaml
|
195
|
+
- testdata/tokens/escaped-alternation.yaml
|
196
|
+
- testdata/tokens/escaped-char-has-start-index-of-text-token.yaml
|
197
|
+
- testdata/tokens/escaped-end-of-line.yaml
|
198
|
+
- testdata/tokens/escaped-optional.yaml
|
199
|
+
- testdata/tokens/escaped-parameter.yaml
|
200
|
+
- testdata/tokens/escaped-space.yaml
|
201
|
+
- testdata/tokens/optional-phrase.yaml
|
202
|
+
- testdata/tokens/optional.yaml
|
203
|
+
- testdata/tokens/parameter-phrase.yaml
|
204
|
+
- testdata/tokens/parameter.yaml
|
205
|
+
- testdata/tokens/phrase.yaml
|
101
206
|
homepage: https://github.com/cucumber/cucumber-expressions-ruby#readme
|
102
207
|
licenses:
|
103
208
|
- MIT
|
@@ -123,18 +228,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
228
|
- !ruby/object:Gem::Version
|
124
229
|
version: '0'
|
125
230
|
requirements: []
|
126
|
-
|
127
|
-
rubygems_version: 2.7.6.2
|
231
|
+
rubygems_version: 3.1.2
|
128
232
|
signing_key:
|
129
233
|
specification_version: 4
|
130
|
-
summary: cucumber-expressions-
|
234
|
+
summary: cucumber-expressions-11.0.1
|
131
235
|
test_files:
|
132
236
|
- spec/capture_warnings.rb
|
133
237
|
- spec/cucumber/cucumber_expressions/argument_spec.rb
|
134
238
|
- spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_test.rb
|
135
239
|
- spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb
|
136
|
-
- spec/cucumber/cucumber_expressions/
|
240
|
+
- spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb
|
137
241
|
- spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb
|
242
|
+
- spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
|
138
243
|
- spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb
|
139
244
|
- spec/cucumber/cucumber_expressions/expression_examples_spec.rb
|
140
245
|
- spec/cucumber/cucumber_expressions/expression_factory_spec.rb
|
@@ -1,57 +0,0 @@
|
|
1
|
-
require 'cucumber/cucumber_expressions/cucumber_expression'
|
2
|
-
require 'cucumber/cucumber_expressions/parameter_type_registry'
|
3
|
-
|
4
|
-
module Cucumber
|
5
|
-
module CucumberExpressions
|
6
|
-
describe CucumberExpression do
|
7
|
-
context "Regexp translation" do
|
8
|
-
def assert_regexp(expression, regexp)
|
9
|
-
cucumber_expression = CucumberExpression.new(expression, ParameterTypeRegistry.new)
|
10
|
-
expect(regexp).to eq(cucumber_expression.regexp)
|
11
|
-
end
|
12
|
-
|
13
|
-
it "translates no arguments" do
|
14
|
-
assert_regexp(
|
15
|
-
"I have 10 cukes in my belly now",
|
16
|
-
/^I have 10 cukes in my belly now$/
|
17
|
-
)
|
18
|
-
end
|
19
|
-
|
20
|
-
it "translates alternation" do
|
21
|
-
assert_regexp(
|
22
|
-
"I had/have a great/nice/charming friend",
|
23
|
-
/^I (?:had|have) a (?:great|nice|charming) friend$/
|
24
|
-
)
|
25
|
-
end
|
26
|
-
|
27
|
-
it "translates alternation with non-alpha" do
|
28
|
-
assert_regexp(
|
29
|
-
"I said Alpha1/Beta1",
|
30
|
-
/^I said (?:Alpha1|Beta1)$/
|
31
|
-
)
|
32
|
-
end
|
33
|
-
|
34
|
-
it "translates parameters" do
|
35
|
-
assert_regexp(
|
36
|
-
"I have {float} cukes at {int} o'clock",
|
37
|
-
/^I have ((?=.*\d.*)[-+]?\d*(?:\.(?=\d.*))?\d*(?:\d+[E][-+]?\d+)?) cukes at ((?:-?\d+)|(?:\d+)) o'clock$/
|
38
|
-
)
|
39
|
-
end
|
40
|
-
|
41
|
-
it "translates parenthesis to non-capturing optional capture group" do
|
42
|
-
assert_regexp(
|
43
|
-
"I have many big(ish) cukes",
|
44
|
-
/^I have many big(?:ish)? cukes$/
|
45
|
-
)
|
46
|
-
end
|
47
|
-
|
48
|
-
it "translates parenthesis with alpha unicode" do
|
49
|
-
assert_regexp(
|
50
|
-
"Привет, Мир(ы)!",
|
51
|
-
/^Привет, Мир(?:ы)?!$/
|
52
|
-
)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|