gherkin 2.9.3 → 2.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.md +7 -0
- data/README.md +43 -39
- data/examples/parse_and_output_json.rb +1 -1
- data/ext/gherkin_lexer_bm/extconf.rb +6 -0
- data/ext/gherkin_lexer_bm/gherkin_lexer_bm.c +1337 -0
- data/ext/gherkin_lexer_pt/gherkin_lexer_pt.c +766 -405
- data/gherkin.gemspec +8 -8
- data/install_mingw_os_x.sh +7 -0
- data/lib/gherkin/formatter/step_printer.rb +7 -3
- data/lib/gherkin/i18n.rb +2 -2
- data/lib/gherkin/i18n.yml +17 -4
- data/lib/gherkin/native/java.rb +1 -1
- data/lib/gherkin/rb_lexer/bm.rb +1081 -0
- data/lib/gherkin/rb_lexer/pt.rb +750 -414
- data/spec/gherkin/fixtures/i18n_pt1.feature +44 -0
- data/spec/gherkin/fixtures/i18n_pt2.feature +4 -0
- data/spec/gherkin/fixtures/i18n_pt3.feature +4 -0
- data/spec/gherkin/fixtures/i18n_pt4.feature +4 -0
- data/spec/gherkin/formatter/pretty_formatter_spec.rb +19 -0
- data/spec/gherkin/i18n_spec.rb +75 -2
- data/spec/gherkin/json_parser_spec.rb +3 -3
- data/tasks/ragel_task.rb +1 -1
- metadata +23 -26
@@ -0,0 +1,44 @@
|
|
1
|
+
# language: pt
|
2
|
+
Funcionalidade: Reconhece "Funcionalidade"
|
3
|
+
|
4
|
+
Contexto: Reconhece "Contexto"
|
5
|
+
|
6
|
+
Cenário: Reconhece "Cenário" com acento
|
7
|
+
|
8
|
+
Cenario: Reconhece "Cenário" sem acento
|
9
|
+
|
10
|
+
Esquema do Cenário: Reconhece "Esquema do Cenário" com acento
|
11
|
+
Dado que <Valor> é um valor e que reconhece "Dado";
|
12
|
+
Dada a afirmação de que reconhece "Dada";
|
13
|
+
Dados os factos acima e ainda que reconhece "Dados";
|
14
|
+
Dadas as afirmações acima e ainda que reconhece "Dadas";
|
15
|
+
Quando reconhece "Quando";
|
16
|
+
Então também reconhece "Então" com acento e
|
17
|
+
Entao também reconhece "Então" sem acento;
|
18
|
+
E reconhece "E";
|
19
|
+
Mas também reconhece "Mas".
|
20
|
+
|
21
|
+
Exemplos: Reconhece "Exemplos"
|
22
|
+
| Valor |
|
23
|
+
| 1 |
|
24
|
+
|
25
|
+
Esquema do Cenario: Reconhece "Esquema do Cenário" sem acento
|
26
|
+
Dado que <Valor> é um valor;
|
27
|
+
|
28
|
+
Cenários: Reconhece "Cenários" com acento
|
29
|
+
| Valor |
|
30
|
+
| 1 |
|
31
|
+
|
32
|
+
Delineação do Cenário: Reconhece "Delineação do Cenário" com acento
|
33
|
+
Dado que <Valor> é um valor;
|
34
|
+
|
35
|
+
Cenarios: Reconhece "Cenários" sem acento
|
36
|
+
| Valor |
|
37
|
+
| 1 |
|
38
|
+
|
39
|
+
Delineacao do Cenario: Reconhece "Delineação do Cenário" sem acento
|
40
|
+
Dado que <Valor> é um valor;
|
41
|
+
|
42
|
+
Exemplos: Reconhece "Exemplos"
|
43
|
+
| Valor |
|
44
|
+
| 1 |
|
@@ -95,6 +95,25 @@ module Gherkin
|
|
95
95
|
)
|
96
96
|
end
|
97
97
|
|
98
|
+
# See https://github.com/cucumber/gherkin/pull/171
|
99
|
+
it "should highlight arguments when there are optional arguments" do
|
100
|
+
@f.uri("foo.feature")
|
101
|
+
@f.scenario(Model::Scenario.new([], [], "Scenario", "Lots of cukes", "", 3, "lots-of-cukes"))
|
102
|
+
@f.step(Model::Step.new([], "Given ", "I have 999 cukes in my belly", 3, nil, nil))
|
103
|
+
@f.match(Model::Match.new([
|
104
|
+
Gherkin::Formatter::Argument.new(nil, nil), # An optional argument
|
105
|
+
Gherkin::Formatter::Argument.new(7, '999')
|
106
|
+
], nil))
|
107
|
+
@f.result(Model::Result.new('passed', 6, nil))
|
108
|
+
|
109
|
+
assert_io(
|
110
|
+
"\n" +
|
111
|
+
" Scenario: Lots of cukes \e[90m# foo.feature:3\e[0m\n" +
|
112
|
+
" #{executing}Given #{reset}#{executing}I have #{reset}#{executing_arg}999#{reset}#{executing} cukes in my belly#{reset}\n" +
|
113
|
+
"#{up(1)} #{passed}Given #{reset}#{passed}I have #{reset}#{passed_arg}999#{reset}#{passed} cukes in my belly#{reset}\n"
|
114
|
+
)
|
115
|
+
end
|
116
|
+
|
98
117
|
it "should prettify scenario" do
|
99
118
|
assert_pretty(%{Feature: Feature Description
|
100
119
|
Some preamble
|
data/spec/gherkin/i18n_spec.rb
CHANGED
@@ -76,6 +76,80 @@ module Gherkin
|
|
76
76
|
]
|
77
77
|
end
|
78
78
|
|
79
|
+
it "should recognize keywords in Portuguese (1st variant)" do
|
80
|
+
lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)
|
81
|
+
scan_file(lexer, "i18n_pt1.feature")
|
82
|
+
@listener.to_sexp.should == [
|
83
|
+
[:comment, "# language: pt", 1],
|
84
|
+
[:feature, "Funcionalidade", "Reconhece \"Funcionalidade\"", "", 2],
|
85
|
+
[:background, "Contexto", "Reconhece \"Contexto\"", "", 4],
|
86
|
+
[:scenario, "Cenário", "Reconhece \"Cenário\" com acento", "", 6],
|
87
|
+
[:scenario, "Cenario", "Reconhece \"Cenário\" sem acento", "", 8],
|
88
|
+
[:scenario_outline, "Esquema do Cenário", "Reconhece \"Esquema do Cenário\" com acento", "", 10],
|
89
|
+
[:step, "Dado ", "que <Valor> é um valor e que reconhece \"Dado\";", 11],
|
90
|
+
[:step, "Dada ", "a afirmação de que reconhece \"Dada\";", 12],
|
91
|
+
[:step, "Dados ", "os factos acima e ainda que reconhece \"Dados\";", 13],
|
92
|
+
[:step, "Dadas ", "as afirmações acima e ainda que reconhece \"Dadas\";", 14],
|
93
|
+
[:step, "Quando ", "reconhece \"Quando\";", 15],
|
94
|
+
[:step, "Então ", "também reconhece \"Então\" com acento e", 16],
|
95
|
+
[:step, "Entao ", "também reconhece \"Então\" sem acento;", 17],
|
96
|
+
[:step, "E ", "reconhece \"E\";", 18],
|
97
|
+
[:step, "Mas ", "também reconhece \"Mas\".", 19],
|
98
|
+
[:examples, "Exemplos", "Reconhece \"Exemplos\"", "", 21],
|
99
|
+
[:row, ["Valor"], 22],
|
100
|
+
[:row, ["1"], 23],
|
101
|
+
[:scenario_outline, "Esquema do Cenario", "Reconhece \"Esquema do Cenário\" sem acento", "", 25],
|
102
|
+
[:step, "Dado ", "que <Valor> é um valor;", 26],
|
103
|
+
[:examples, "Cenários", "Reconhece \"Cenários\" com acento", "", 28],
|
104
|
+
[:row, ["Valor"], 29],
|
105
|
+
[:row, ["1"], 30],
|
106
|
+
[:scenario_outline, "Delineação do Cenário", "Reconhece \"Delineação do Cenário\" com acento", "", 32],
|
107
|
+
[:step, "Dado ", "que <Valor> é um valor;", 33],
|
108
|
+
[:examples, "Cenarios", "Reconhece \"Cenários\" sem acento", "", 35],
|
109
|
+
[:row, ["Valor"], 36],
|
110
|
+
[:row, ["1"], 37],
|
111
|
+
[:scenario_outline, "Delineacao do Cenario", "Reconhece \"Delineação do Cenário\" sem acento", "", 39],
|
112
|
+
[:step, "Dado ", "que <Valor> é um valor;", 40],
|
113
|
+
[:examples, "Exemplos", "Reconhece \"Exemplos\"", "", 42],
|
114
|
+
[:row, ["Valor"], 43],
|
115
|
+
[:row, ["1"], 44],
|
116
|
+
[:eof]
|
117
|
+
]
|
118
|
+
end
|
119
|
+
|
120
|
+
it "should recognize keywords in Portuguese (2nd variant)" do
|
121
|
+
lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)
|
122
|
+
scan_file(lexer, "i18n_pt2.feature")
|
123
|
+
@listener.to_sexp.should == [
|
124
|
+
[:comment, "# language: pt", 1],
|
125
|
+
[:feature, "Característica", "Reconhece \"Característica\" com acento", "", 2],
|
126
|
+
[:background, "Cenário de Fundo", "Reconhece \"Cenário de Fundo\" com acento", "", 4],
|
127
|
+
[:eof]
|
128
|
+
]
|
129
|
+
end
|
130
|
+
|
131
|
+
it "should recognize keywords in Portuguese (3rd variant)" do
|
132
|
+
lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)
|
133
|
+
scan_file(lexer, "i18n_pt3.feature")
|
134
|
+
@listener.to_sexp.should == [
|
135
|
+
[:comment, "# language: pt", 1],
|
136
|
+
[:feature, "Caracteristica", "Reconhece \"Característica\" sem acento", "", 2],
|
137
|
+
[:background, "Cenario de Fundo", "Reconhece \"Cenário de Fundo\" sem acento", "", 4],
|
138
|
+
[:eof]
|
139
|
+
]
|
140
|
+
end
|
141
|
+
|
142
|
+
it "should recognize keywords in Portuguese (4th variant)" do
|
143
|
+
lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)
|
144
|
+
scan_file(lexer, "i18n_pt4.feature")
|
145
|
+
@listener.to_sexp.should == [
|
146
|
+
[:comment, "# language: pt", 1],
|
147
|
+
[:feature, "Característica", "Reconhece \"Característica\" com acento", "", 2],
|
148
|
+
[:background, "Fundo", "Reconhece \"Fundo\"", "", 4],
|
149
|
+
[:eof]
|
150
|
+
]
|
151
|
+
end
|
152
|
+
|
79
153
|
describe 'keywords' do
|
80
154
|
it "should have code keywords without space, comma, exclamation or apostrophe" do
|
81
155
|
['Avast', 'Akkor', 'Etantdonné', 'Lorsque', '假設'].each do |code_keyword|
|
@@ -91,11 +165,11 @@ module Gherkin
|
|
91
165
|
Gherkin::I18n.keyword_regexp(:step).should =~ /\|Quando \|Quand \|Quan \|Pryd \|Pokud \|/
|
92
166
|
end
|
93
167
|
|
94
|
-
unless defined?(JRUBY_VERSION)
|
95
168
|
it "should print available languages" do
|
96
169
|
("\n" + Gherkin::I18n.language_table).should == %{
|
97
170
|
| ar | Arabic | العربية |
|
98
171
|
| bg | Bulgarian | български |
|
172
|
+
| bm | Malay | Bahasa Melayu |
|
99
173
|
| ca | Catalan | català |
|
100
174
|
| cs | Czech | Česky |
|
101
175
|
| cy-GB | Welsh | Cymraeg |
|
@@ -141,7 +215,6 @@ module Gherkin
|
|
141
215
|
| zh-TW | Chinese traditional | 繁體中文 |
|
142
216
|
}
|
143
217
|
end
|
144
|
-
end
|
145
218
|
|
146
219
|
it "should print keywords for a given language" do
|
147
220
|
("\n" + Gherkin::I18n.get('fr').keyword_table).should == %{
|
@@ -29,7 +29,7 @@ module Gherkin
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
it "should parse a barely empty feature" do
|
33
33
|
check_json(%{[
|
34
34
|
{
|
35
35
|
"id": "one",
|
@@ -42,7 +42,7 @@ module Gherkin
|
|
42
42
|
]})
|
43
43
|
end
|
44
44
|
|
45
|
-
|
45
|
+
it "should parse feature with tags and one scenario" do
|
46
46
|
check_json(%{[
|
47
47
|
{
|
48
48
|
"id": "one",
|
@@ -131,7 +131,7 @@ module Gherkin
|
|
131
131
|
})
|
132
132
|
end
|
133
133
|
|
134
|
-
|
134
|
+
it "shoud parse a complex feature" do
|
135
135
|
check_json('[' + fixture("complex.json") + ']')
|
136
136
|
end
|
137
137
|
end
|
data/tasks/ragel_task.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gherkin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.10.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-
|
14
|
+
date: 2012-05-07 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rake-compiler
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.
|
55
|
+
version: 1.2.0
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
58
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -60,7 +60,7 @@ dependencies:
|
|
60
60
|
requirements:
|
61
61
|
- - ! '>='
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 1.
|
63
|
+
version: 1.2.0
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: rake
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,7 +116,7 @@ dependencies:
|
|
116
116
|
requirements:
|
117
117
|
- - ! '>='
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: 0.9.
|
119
|
+
version: 0.9.8
|
120
120
|
type: :development
|
121
121
|
prerelease: false
|
122
122
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -124,23 +124,7 @@ dependencies:
|
|
124
124
|
requirements:
|
125
125
|
- - ! '>='
|
126
126
|
- !ruby/object:Gem::Version
|
127
|
-
version: 0.9.
|
128
|
-
- !ruby/object:Gem::Dependency
|
129
|
-
name: therubyracer
|
130
|
-
requirement: !ruby/object:Gem::Requirement
|
131
|
-
none: false
|
132
|
-
requirements:
|
133
|
-
- - ! '>='
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
version: 0.9.10
|
136
|
-
type: :development
|
137
|
-
prerelease: false
|
138
|
-
version_requirements: !ruby/object:Gem::Requirement
|
139
|
-
none: false
|
140
|
-
requirements:
|
141
|
-
- - ! '>='
|
142
|
-
- !ruby/object:Gem::Version
|
143
|
-
version: 0.9.10
|
127
|
+
version: 0.9.8
|
144
128
|
- !ruby/object:Gem::Dependency
|
145
129
|
name: yard
|
146
130
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,7 +132,7 @@ dependencies:
|
|
148
132
|
requirements:
|
149
133
|
- - ! '>='
|
150
134
|
- !ruby/object:Gem::Version
|
151
|
-
version: 0.
|
135
|
+
version: 0.8.0
|
152
136
|
type: :development
|
153
137
|
prerelease: false
|
154
138
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -156,7 +140,7 @@ dependencies:
|
|
156
140
|
requirements:
|
157
141
|
- - ! '>='
|
158
142
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.
|
143
|
+
version: 0.8.0
|
160
144
|
- !ruby/object:Gem::Dependency
|
161
145
|
name: rdiscount
|
162
146
|
requirement: !ruby/object:Gem::Requirement
|
@@ -211,6 +195,7 @@ executables: []
|
|
211
195
|
extensions:
|
212
196
|
- ext/gherkin_lexer_ar/extconf.rb
|
213
197
|
- ext/gherkin_lexer_bg/extconf.rb
|
198
|
+
- ext/gherkin_lexer_bm/extconf.rb
|
214
199
|
- ext/gherkin_lexer_ca/extconf.rb
|
215
200
|
- ext/gherkin_lexer_cs/extconf.rb
|
216
201
|
- ext/gherkin_lexer_cy_gb/extconf.rb
|
@@ -287,6 +272,7 @@ files:
|
|
287
272
|
- features/steps_parser.feature
|
288
273
|
- features/support/env.rb
|
289
274
|
- gherkin.gemspec
|
275
|
+
- install_mingw_os_x.sh
|
290
276
|
- js/.npmignore
|
291
277
|
- js/lib/gherkin/lexer/.npmignore
|
292
278
|
- lib/gherkin.rb
|
@@ -341,6 +327,10 @@ files:
|
|
341
327
|
- spec/gherkin/fixtures/i18n_fr.feature
|
342
328
|
- spec/gherkin/fixtures/i18n_fr2.feature
|
343
329
|
- spec/gherkin/fixtures/i18n_no.feature
|
330
|
+
- spec/gherkin/fixtures/i18n_pt1.feature
|
331
|
+
- spec/gherkin/fixtures/i18n_pt2.feature
|
332
|
+
- spec/gherkin/fixtures/i18n_pt3.feature
|
333
|
+
- spec/gherkin/fixtures/i18n_pt4.feature
|
344
334
|
- spec/gherkin/fixtures/i18n_zh-CN.feature
|
345
335
|
- spec/gherkin/fixtures/issue_145.feature
|
346
336
|
- spec/gherkin/fixtures/scenario_outline_with_tags.feature
|
@@ -393,6 +383,7 @@ files:
|
|
393
383
|
- tasks/yard/default/layout/html/setup.rb
|
394
384
|
- lib/gherkin/rb_lexer/ar.rb
|
395
385
|
- lib/gherkin/rb_lexer/bg.rb
|
386
|
+
- lib/gherkin/rb_lexer/bm.rb
|
396
387
|
- lib/gherkin/rb_lexer/ca.rb
|
397
388
|
- lib/gherkin/rb_lexer/cs.rb
|
398
389
|
- lib/gherkin/rb_lexer/cy_gb.rb
|
@@ -438,6 +429,7 @@ files:
|
|
438
429
|
- lib/gherkin/rb_lexer/zh_tw.rb
|
439
430
|
- ext/gherkin_lexer_ar/gherkin_lexer_ar.c
|
440
431
|
- ext/gherkin_lexer_bg/gherkin_lexer_bg.c
|
432
|
+
- ext/gherkin_lexer_bm/gherkin_lexer_bm.c
|
441
433
|
- ext/gherkin_lexer_ca/gherkin_lexer_ca.c
|
442
434
|
- ext/gherkin_lexer_cs/gherkin_lexer_cs.c
|
443
435
|
- ext/gherkin_lexer_cy_gb/gherkin_lexer_cy_gb.c
|
@@ -483,6 +475,7 @@ files:
|
|
483
475
|
- ext/gherkin_lexer_zh_tw/gherkin_lexer_zh_tw.c
|
484
476
|
- ext/gherkin_lexer_ar/extconf.rb
|
485
477
|
- ext/gherkin_lexer_bg/extconf.rb
|
478
|
+
- ext/gherkin_lexer_bm/extconf.rb
|
486
479
|
- ext/gherkin_lexer_ca/extconf.rb
|
487
480
|
- ext/gherkin_lexer_cs/extconf.rb
|
488
481
|
- ext/gherkin_lexer_cy_gb/extconf.rb
|
@@ -547,10 +540,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
547
540
|
version: '0'
|
548
541
|
requirements: []
|
549
542
|
rubyforge_project:
|
550
|
-
rubygems_version: 1.8.
|
543
|
+
rubygems_version: 1.8.24
|
551
544
|
signing_key:
|
552
545
|
specification_version: 3
|
553
|
-
summary: gherkin-2.
|
546
|
+
summary: gherkin-2.10.0
|
554
547
|
test_files:
|
555
548
|
- features/escaped_pipes.feature
|
556
549
|
- features/feature_parser.feature
|
@@ -579,6 +572,10 @@ test_files:
|
|
579
572
|
- spec/gherkin/fixtures/i18n_fr.feature
|
580
573
|
- spec/gherkin/fixtures/i18n_fr2.feature
|
581
574
|
- spec/gherkin/fixtures/i18n_no.feature
|
575
|
+
- spec/gherkin/fixtures/i18n_pt1.feature
|
576
|
+
- spec/gherkin/fixtures/i18n_pt2.feature
|
577
|
+
- spec/gherkin/fixtures/i18n_pt3.feature
|
578
|
+
- spec/gherkin/fixtures/i18n_pt4.feature
|
582
579
|
- spec/gherkin/fixtures/i18n_zh-CN.feature
|
583
580
|
- spec/gherkin/fixtures/issue_145.feature
|
584
581
|
- spec/gherkin/fixtures/scenario_outline_with_tags.feature
|