gherkin 2.12.2 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -15
- data/CONTRIBUTING.md +23 -0
- data/Gemfile +0 -3
- data/LICENSE +18 -17
- data/Makefile +65 -0
- data/README.md +9 -268
- data/Rakefile +17 -19
- data/bin/gherkin-generate-ast +21 -0
- data/bin/gherkin-generate-pickles +25 -0
- data/bin/gherkin-generate-tokens +12 -0
- data/gherkin-ruby.razor +218 -0
- data/gherkin.gemspec +22 -76
- data/lib/gherkin/ast_builder.rb +243 -0
- data/lib/gherkin/ast_node.rb +30 -0
- data/lib/gherkin/dialect.rb +58 -0
- data/lib/gherkin/errors.rb +45 -0
- data/lib/gherkin/gherkin-languages.json +2968 -0
- data/lib/gherkin/gherkin_line.rb +95 -0
- data/lib/gherkin/parser.rb +1910 -0
- data/lib/gherkin/pickles/compiler.rb +164 -0
- data/lib/gherkin/token.rb +18 -0
- data/lib/gherkin/token_formatter_builder.rb +39 -0
- data/lib/gherkin/token_matcher.rb +169 -0
- data/lib/gherkin/token_scanner.rb +40 -0
- data/spec/capture_warnings.rb +68 -0
- data/spec/coverage.rb +10 -0
- data/spec/gherkin/parser_spec.rb +146 -0
- metadata +60 -567
- data/.gitattributes +0 -2
- data/.mailmap +0 -2
- data/.rbenv-gemsets +0 -1
- data/.rspec +0 -1
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.yardopts +0 -5
- data/History.md +0 -881
- data/build_native_gems.sh +0 -7
- data/cucumber.yml +0 -5
- data/examples/parse_and_output_json.rb +0 -19
- data/ext/gherkin_lexer_ar/extconf.rb +0 -6
- data/ext/gherkin_lexer_ar/gherkin_lexer_ar.c +0 -1432
- data/ext/gherkin_lexer_bg/extconf.rb +0 -6
- data/ext/gherkin_lexer_bg/gherkin_lexer_bg.c +0 -1655
- data/ext/gherkin_lexer_bm/extconf.rb +0 -6
- data/ext/gherkin_lexer_bm/gherkin_lexer_bm.c +0 -1516
- data/ext/gherkin_lexer_ca/extconf.rb +0 -6
- data/ext/gherkin_lexer_ca/gherkin_lexer_ca.c +0 -1581
- data/ext/gherkin_lexer_cs/extconf.rb +0 -6
- data/ext/gherkin_lexer_cs/gherkin_lexer_cs.c +0 -1515
- data/ext/gherkin_lexer_cy_gb/extconf.rb +0 -6
- data/ext/gherkin_lexer_cy_gb/gherkin_lexer_cy_gb.c +0 -1282
- data/ext/gherkin_lexer_da/extconf.rb +0 -6
- data/ext/gherkin_lexer_da/gherkin_lexer_da.c +0 -1298
- data/ext/gherkin_lexer_de/extconf.rb +0 -6
- data/ext/gherkin_lexer_de/gherkin_lexer_de.c +0 -1425
- data/ext/gherkin_lexer_el/extconf.rb +0 -6
- data/ext/gherkin_lexer_el/gherkin_lexer_el.c +0 -1919
- data/ext/gherkin_lexer_en/extconf.rb +0 -6
- data/ext/gherkin_lexer_en/gherkin_lexer_en.c +0 -1418
- data/ext/gherkin_lexer_en_au/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_au/gherkin_lexer_en_au.c +0 -1765
- data/ext/gherkin_lexer_en_lol/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_lol/gherkin_lexer_en_lol.c +0 -1177
- data/ext/gherkin_lexer_en_old/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_old/gherkin_lexer_en_old.c +0 -1309
- data/ext/gherkin_lexer_en_pirate/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_pirate/gherkin_lexer_en_pirate.c +0 -1471
- data/ext/gherkin_lexer_en_scouse/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_scouse/gherkin_lexer_en_scouse.c +0 -1634
- data/ext/gherkin_lexer_en_tx/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_tx/gherkin_lexer_en_tx.c +0 -1265
- data/ext/gherkin_lexer_eo/extconf.rb +0 -6
- data/ext/gherkin_lexer_eo/gherkin_lexer_eo.c +0 -1241
- data/ext/gherkin_lexer_es/extconf.rb +0 -6
- data/ext/gherkin_lexer_es/gherkin_lexer_es.c +0 -1399
- data/ext/gherkin_lexer_et/extconf.rb +0 -6
- data/ext/gherkin_lexer_et/gherkin_lexer_et.c +0 -1236
- data/ext/gherkin_lexer_fa/extconf.rb +0 -6
- data/ext/gherkin_lexer_fa/gherkin_lexer_fa.c +0 -1475
- data/ext/gherkin_lexer_fi/extconf.rb +0 -6
- data/ext/gherkin_lexer_fi/gherkin_lexer_fi.c +0 -1215
- data/ext/gherkin_lexer_fr/extconf.rb +0 -6
- data/ext/gherkin_lexer_fr/gherkin_lexer_fr.c +0 -1493
- data/ext/gherkin_lexer_gl/extconf.rb +0 -6
- data/ext/gherkin_lexer_gl/gherkin_lexer_gl.c +0 -1374
- data/ext/gherkin_lexer_he/extconf.rb +0 -6
- data/ext/gherkin_lexer_he/gherkin_lexer_he.c +0 -1374
- data/ext/gherkin_lexer_hi/extconf.rb +0 -6
- data/ext/gherkin_lexer_hi/gherkin_lexer_hi.c +0 -1848
- data/ext/gherkin_lexer_hr/extconf.rb +0 -6
- data/ext/gherkin_lexer_hr/gherkin_lexer_hr.c +0 -1323
- data/ext/gherkin_lexer_hu/extconf.rb +0 -6
- data/ext/gherkin_lexer_hu/gherkin_lexer_hu.c +0 -1376
- data/ext/gherkin_lexer_id/extconf.rb +0 -6
- data/ext/gherkin_lexer_id/gherkin_lexer_id.c +0 -1208
- data/ext/gherkin_lexer_is/extconf.rb +0 -6
- data/ext/gherkin_lexer_is/gherkin_lexer_is.c +0 -1376
- data/ext/gherkin_lexer_it/extconf.rb +0 -6
- data/ext/gherkin_lexer_it/gherkin_lexer_it.c +0 -1340
- data/ext/gherkin_lexer_ja/extconf.rb +0 -6
- data/ext/gherkin_lexer_ja/gherkin_lexer_ja.c +0 -1699
- data/ext/gherkin_lexer_kn/extconf.rb +0 -6
- data/ext/gherkin_lexer_kn/gherkin_lexer_kn.c +0 -1965
- data/ext/gherkin_lexer_ko/extconf.rb +0 -6
- data/ext/gherkin_lexer_ko/gherkin_lexer_ko.c +0 -1360
- data/ext/gherkin_lexer_lt/extconf.rb +0 -6
- data/ext/gherkin_lexer_lt/gherkin_lexer_lt.c +0 -1296
- data/ext/gherkin_lexer_lu/extconf.rb +0 -6
- data/ext/gherkin_lexer_lu/gherkin_lexer_lu.c +0 -1389
- data/ext/gherkin_lexer_lv/extconf.rb +0 -6
- data/ext/gherkin_lexer_lv/gherkin_lexer_lv.c +0 -1425
- data/ext/gherkin_lexer_nl/extconf.rb +0 -6
- data/ext/gherkin_lexer_nl/gherkin_lexer_nl.c +0 -1368
- data/ext/gherkin_lexer_no/extconf.rb +0 -6
- data/ext/gherkin_lexer_no/gherkin_lexer_no.c +0 -1311
- data/ext/gherkin_lexer_pa/extconf.rb +0 -6
- data/ext/gherkin_lexer_pa/gherkin_lexer_pa.c +0 -2160
- data/ext/gherkin_lexer_pl/extconf.rb +0 -6
- data/ext/gherkin_lexer_pl/gherkin_lexer_pl.c +0 -1738
- data/ext/gherkin_lexer_pt/extconf.rb +0 -6
- data/ext/gherkin_lexer_pt/gherkin_lexer_pt.c +0 -1711
- data/ext/gherkin_lexer_ro/extconf.rb +0 -6
- data/ext/gherkin_lexer_ro/gherkin_lexer_ro.c +0 -1427
- data/ext/gherkin_lexer_ru/extconf.rb +0 -6
- data/ext/gherkin_lexer_ru/gherkin_lexer_ru.c +0 -2071
- data/ext/gherkin_lexer_sk/extconf.rb +0 -6
- data/ext/gherkin_lexer_sk/gherkin_lexer_sk.c +0 -1739
- data/ext/gherkin_lexer_sr_cyrl/extconf.rb +0 -6
- data/ext/gherkin_lexer_sr_cyrl/gherkin_lexer_sr_cyrl.c +0 -2112
- data/ext/gherkin_lexer_sr_latn/extconf.rb +0 -6
- data/ext/gherkin_lexer_sr_latn/gherkin_lexer_sr_latn.c +0 -1567
- data/ext/gherkin_lexer_sv/extconf.rb +0 -6
- data/ext/gherkin_lexer_sv/gherkin_lexer_sv.c +0 -1324
- data/ext/gherkin_lexer_th/extconf.rb +0 -6
- data/ext/gherkin_lexer_th/gherkin_lexer_th.c +0 -2840
- data/ext/gherkin_lexer_tl/extconf.rb +0 -6
- data/ext/gherkin_lexer_tl/gherkin_lexer_tl.c +0 -2021
- data/ext/gherkin_lexer_tr/extconf.rb +0 -6
- data/ext/gherkin_lexer_tr/gherkin_lexer_tr.c +0 -1347
- data/ext/gherkin_lexer_tt/extconf.rb +0 -6
- data/ext/gherkin_lexer_tt/gherkin_lexer_tt.c +0 -1936
- data/ext/gherkin_lexer_uk/extconf.rb +0 -6
- data/ext/gherkin_lexer_uk/gherkin_lexer_uk.c +0 -1941
- data/ext/gherkin_lexer_uz/extconf.rb +0 -6
- data/ext/gherkin_lexer_uz/gherkin_lexer_uz.c +0 -1651
- data/ext/gherkin_lexer_vi/extconf.rb +0 -6
- data/ext/gherkin_lexer_vi/gherkin_lexer_vi.c +0 -1458
- data/ext/gherkin_lexer_zh_cn/extconf.rb +0 -6
- data/ext/gherkin_lexer_zh_cn/gherkin_lexer_zh_cn.c +0 -1314
- data/ext/gherkin_lexer_zh_tw/extconf.rb +0 -6
- data/ext/gherkin_lexer_zh_tw/gherkin_lexer_zh_tw.c +0 -1307
- data/features/.cucumber/stepdefs.json +0 -244
- data/features/escaped_pipes.feature +0 -8
- data/features/feature_parser.feature +0 -237
- data/features/json_formatter.feature +0 -498
- data/features/json_parser.feature +0 -331
- data/features/native_lexer.feature +0 -19
- data/features/parser_with_native_lexer.feature +0 -205
- data/features/pretty_formatter.feature +0 -17
- data/features/step_definitions/eyeball_steps.rb +0 -3
- data/features/step_definitions/gherkin_steps.rb +0 -29
- data/features/step_definitions/json_formatter_steps.rb +0 -30
- data/features/step_definitions/json_parser_steps.rb +0 -21
- data/features/step_definitions/pretty_formatter_steps.rb +0 -85
- data/features/steps_parser.feature +0 -46
- data/features/support/env.rb +0 -41
- data/install_mingw_os_x.sh +0 -5
- data/js/.npmignore +0 -1
- data/js/lib/gherkin/lexer/.npmignore +0 -0
- data/lib/gherkin.rb +0 -2
- data/lib/gherkin/README.md +0 -7
- data/lib/gherkin/c_lexer.rb +0 -17
- data/lib/gherkin/formatter/ansi_escapes.rb +0 -97
- data/lib/gherkin/formatter/argument.rb +0 -16
- data/lib/gherkin/formatter/escaping.rb +0 -15
- data/lib/gherkin/formatter/filter_formatter.rb +0 -150
- data/lib/gherkin/formatter/hashable.rb +0 -25
- data/lib/gherkin/formatter/json_formatter.rb +0 -133
- data/lib/gherkin/formatter/line_filter.rb +0 -26
- data/lib/gherkin/formatter/model.rb +0 -281
- data/lib/gherkin/formatter/pretty_formatter.rb +0 -245
- data/lib/gherkin/formatter/regexp_filter.rb +0 -21
- data/lib/gherkin/formatter/step_printer.rb +0 -21
- data/lib/gherkin/formatter/tag_count_formatter.rb +0 -47
- data/lib/gherkin/formatter/tag_filter.rb +0 -19
- data/lib/gherkin/i18n.json +0 -786
- data/lib/gherkin/i18n.rb +0 -176
- data/lib/gherkin/json_parser.rb +0 -177
- data/lib/gherkin/lexer/ar.rb +0 -1170
- data/lib/gherkin/lexer/bg.rb +0 -1382
- data/lib/gherkin/lexer/bm.rb +0 -1250
- data/lib/gherkin/lexer/ca.rb +0 -1310
- data/lib/gherkin/lexer/cs.rb +0 -1246
- data/lib/gherkin/lexer/cy_gb.rb +0 -1032
- data/lib/gherkin/lexer/da.rb +0 -1048
- data/lib/gherkin/lexer/de.rb +0 -1166
- data/lib/gherkin/lexer/el.rb +0 -1628
- data/lib/gherkin/lexer/en.rb +0 -1156
- data/lib/gherkin/lexer/en_au.rb +0 -1486
- data/lib/gherkin/lexer/en_lol.rb +0 -934
- data/lib/gherkin/lexer/en_old.rb +0 -1037
- data/lib/gherkin/lexer/en_pirate.rb +0 -1210
- data/lib/gherkin/lexer/en_scouse.rb +0 -1362
- data/lib/gherkin/lexer/en_tx.rb +0 -1016
- data/lib/gherkin/lexer/encoding.rb +0 -41
- data/lib/gherkin/lexer/eo.rb +0 -995
- data/lib/gherkin/lexer/es.rb +0 -1140
- data/lib/gherkin/lexer/et.rb +0 -990
- data/lib/gherkin/lexer/fa.rb +0 -1214
- data/lib/gherkin/lexer/fi.rb +0 -969
- data/lib/gherkin/lexer/fr.rb +0 -1228
- data/lib/gherkin/lexer/gl.rb +0 -1117
- data/lib/gherkin/lexer/he.rb +0 -1118
- data/lib/gherkin/lexer/hi.rb +0 -1559
- data/lib/gherkin/lexer/hr.rb +0 -1066
- data/lib/gherkin/lexer/hu.rb +0 -1118
- data/lib/gherkin/lexer/i18n_lexer.rb +0 -48
- data/lib/gherkin/lexer/id.rb +0 -963
- data/lib/gherkin/lexer/is.rb +0 -1120
- data/lib/gherkin/lexer/it.rb +0 -1086
- data/lib/gherkin/lexer/ja.rb +0 -1418
- data/lib/gherkin/lexer/kn.rb +0 -1672
- data/lib/gherkin/lexer/ko.rb +0 -1102
- data/lib/gherkin/lexer/lt.rb +0 -1045
- data/lib/gherkin/lexer/lu.rb +0 -1132
- data/lib/gherkin/lexer/lv.rb +0 -1166
- data/lib/gherkin/lexer/nl.rb +0 -1115
- data/lib/gherkin/lexer/no.rb +0 -1060
- data/lib/gherkin/lexer/pa.rb +0 -1852
- data/lib/gherkin/lexer/pl.rb +0 -1457
- data/lib/gherkin/lexer/pt.rb +0 -1430
- data/lib/gherkin/lexer/ro.rb +0 -1164
- data/lib/gherkin/lexer/ru.rb +0 -1766
- data/lib/gherkin/lexer/sk.rb +0 -1452
- data/lib/gherkin/lexer/sr_cyrl.rb +0 -1803
- data/lib/gherkin/lexer/sr_latn.rb +0 -1294
- data/lib/gherkin/lexer/sv.rb +0 -1070
- data/lib/gherkin/lexer/th.rb +0 -2492
- data/lib/gherkin/lexer/tl.rb +0 -1726
- data/lib/gherkin/lexer/tr.rb +0 -1092
- data/lib/gherkin/lexer/tt.rb +0 -1643
- data/lib/gherkin/lexer/uk.rb +0 -1646
- data/lib/gherkin/lexer/uz.rb +0 -1376
- data/lib/gherkin/lexer/vi.rb +0 -1198
- data/lib/gherkin/lexer/zh_cn.rb +0 -1058
- data/lib/gherkin/lexer/zh_tw.rb +0 -1052
- data/lib/gherkin/listener/event.rb +0 -45
- data/lib/gherkin/listener/formatter_listener.rb +0 -150
- data/lib/gherkin/native.rb +0 -7
- data/lib/gherkin/native/java.rb +0 -72
- data/lib/gherkin/native/null.rb +0 -5
- data/lib/gherkin/native/therubyracer.rb +0 -41
- data/lib/gherkin/parser/meta.txt +0 -5
- data/lib/gherkin/parser/parser.rb +0 -166
- data/lib/gherkin/parser/root.txt +0 -11
- data/lib/gherkin/parser/steps.txt +0 -4
- data/lib/gherkin/platform.rb +0 -13
- data/lib/gherkin/rubify.rb +0 -31
- data/lib/gherkin/tag_expression.rb +0 -63
- data/ragel/lexer.c.rl.erb +0 -454
- data/ragel/lexer.java.rl.erb +0 -219
- data/ragel/lexer.js.rl.erb +0 -322
- data/ragel/lexer.rb.rl.erb +0 -179
- data/ragel/lexer_common.rl.erb +0 -50
- data/spec/gherkin/c_lexer_spec.rb +0 -22
- data/spec/gherkin/fixtures/1.feature +0 -8
- data/spec/gherkin/fixtures/comments_in_table.feature +0 -9
- data/spec/gherkin/fixtures/complex.feature +0 -45
- data/spec/gherkin/fixtures/complex.json +0 -139
- data/spec/gherkin/fixtures/complex_for_filtering.feature +0 -60
- data/spec/gherkin/fixtures/complex_with_tags.feature +0 -61
- data/spec/gherkin/fixtures/dos_line_endings.feature +0 -45
- data/spec/gherkin/fixtures/examples_with_only_header.feature +0 -14
- data/spec/gherkin/fixtures/hantu_pisang.feature +0 -35
- data/spec/gherkin/fixtures/i18n_fr.feature +0 -14
- data/spec/gherkin/fixtures/i18n_fr2.feature +0 -8
- data/spec/gherkin/fixtures/i18n_no.feature +0 -7
- data/spec/gherkin/fixtures/i18n_pt1.feature +0 -44
- data/spec/gherkin/fixtures/i18n_pt2.feature +0 -4
- data/spec/gherkin/fixtures/i18n_pt3.feature +0 -4
- data/spec/gherkin/fixtures/i18n_pt4.feature +0 -4
- data/spec/gherkin/fixtures/i18n_zh-CN.feature +0 -9
- data/spec/gherkin/fixtures/iso-8859-1.feature +0 -6
- data/spec/gherkin/fixtures/issue_145.feature +0 -22
- data/spec/gherkin/fixtures/scenario_outline_with_tags.feature +0 -13
- data/spec/gherkin/fixtures/scenario_without_steps.feature +0 -5
- data/spec/gherkin/fixtures/simple_with_comments.feature +0 -7
- data/spec/gherkin/fixtures/simple_with_tags.feature +0 -11
- data/spec/gherkin/fixtures/with_bom.feature +0 -3
- data/spec/gherkin/fixtures/with_bom_and_language_spec.feature +0 -4
- data/spec/gherkin/formatter/ansi_escapes_spec.rb +0 -32
- data/spec/gherkin/formatter/filter_formatter_spec.rb +0 -204
- data/spec/gherkin/formatter/json_formatter_spec.rb +0 -179
- data/spec/gherkin/formatter/model_spec.rb +0 -28
- data/spec/gherkin/formatter/pretty_formatter_spec.rb +0 -184
- data/spec/gherkin/formatter/spaces.feature +0 -9
- data/spec/gherkin/formatter/step_printer_spec.rb +0 -55
- data/spec/gherkin/formatter/tabs.feature +0 -9
- data/spec/gherkin/formatter/tag_count_formatter_spec.rb +0 -30
- data/spec/gherkin/i18n_spec.rb +0 -256
- data/spec/gherkin/java_lexer_spec.rb +0 -20
- data/spec/gherkin/json_parser_spec.rb +0 -165
- data/spec/gherkin/lexer/i18n_lexer_spec.rb +0 -65
- data/spec/gherkin/native_lexer_spec.rb +0 -29
- data/spec/gherkin/parser/parser_spec.rb +0 -16
- data/spec/gherkin/rubify_spec.rb +0 -23
- data/spec/gherkin/sexp_recorder.rb +0 -59
- data/spec/gherkin/shared/doc_string_group.rb +0 -161
- data/spec/gherkin/shared/encoding_group.rb +0 -48
- data/spec/gherkin/shared/lexer_group.rb +0 -589
- data/spec/gherkin/shared/row_group.rb +0 -123
- data/spec/gherkin/shared/tags_group.rb +0 -52
- data/spec/gherkin/tag_expression_spec.rb +0 -146
- data/spec/spec_helper.rb +0 -94
- data/tasks/apidoc.rake +0 -32
- data/tasks/bench.rake +0 -184
- data/tasks/bench/feature_builder.rb +0 -49
- data/tasks/bench/null_listener.rb +0 -4
- data/tasks/compile.rake +0 -83
- data/tasks/cucumber.rake +0 -23
- data/tasks/gems.rake +0 -46
- data/tasks/ikvm.rake +0 -126
- data/tasks/ragel_task.rb +0 -124
- data/tasks/release.rake +0 -34
- data/tasks/rspec.rake +0 -6
- data/tasks/yard/default/layout/html/bubble_32x32.png +0 -0
- data/tasks/yard/default/layout/html/bubble_48x48.png +0 -0
- data/tasks/yard/default/layout/html/footer.erb +0 -5
- data/tasks/yard/default/layout/html/index.erb +0 -1
- data/tasks/yard/default/layout/html/layout.erb +0 -25
- data/tasks/yard/default/layout/html/logo.erb +0 -1
- data/tasks/yard/default/layout/html/setup.rb +0 -4
@@ -1,498 +0,0 @@
|
|
1
|
-
Feature: JSON formatter
|
2
|
-
In order to support greater access to features
|
3
|
-
we want JSON
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given a JSON formatter
|
7
|
-
And a "ruby" "root" parser
|
8
|
-
|
9
|
-
Scenario: Only a Feature
|
10
|
-
Given the following text is parsed:
|
11
|
-
"""
|
12
|
-
# language: no
|
13
|
-
# Another comment
|
14
|
-
Egenskap: Kjapp
|
15
|
-
"""
|
16
|
-
And the following text is parsed:
|
17
|
-
"""
|
18
|
-
# language: no
|
19
|
-
# Yet another comment
|
20
|
-
Egenskap: Kjappere
|
21
|
-
"""
|
22
|
-
Then the outputted JSON should be:
|
23
|
-
"""
|
24
|
-
[
|
25
|
-
{
|
26
|
-
"comments": [
|
27
|
-
{
|
28
|
-
"line": 1,
|
29
|
-
"value": "# language: no"
|
30
|
-
},
|
31
|
-
{
|
32
|
-
"line": 2,
|
33
|
-
"value": "# Another comment"
|
34
|
-
}
|
35
|
-
],
|
36
|
-
"description": "",
|
37
|
-
"keyword": "Egenskap",
|
38
|
-
"line": 3,
|
39
|
-
"name": "Kjapp",
|
40
|
-
"uri": "test.feature",
|
41
|
-
"id": "kjapp"
|
42
|
-
},
|
43
|
-
{
|
44
|
-
"comments": [
|
45
|
-
{
|
46
|
-
"line": 1,
|
47
|
-
"value": "# language: no"
|
48
|
-
},
|
49
|
-
{
|
50
|
-
"line": 2,
|
51
|
-
"value": "# Yet another comment"
|
52
|
-
}
|
53
|
-
],
|
54
|
-
"description": "",
|
55
|
-
"keyword": "Egenskap",
|
56
|
-
"line": 3,
|
57
|
-
"name": "Kjappere",
|
58
|
-
"uri": "test.feature",
|
59
|
-
"id": "kjappere"
|
60
|
-
}
|
61
|
-
]
|
62
|
-
"""
|
63
|
-
|
64
|
-
Scenario: Feature with scenarios and outlines
|
65
|
-
Given the following text is parsed:
|
66
|
-
"""
|
67
|
-
@one
|
68
|
-
Feature: OH HAI
|
69
|
-
|
70
|
-
Scenario: Fujin
|
71
|
-
Given wind
|
72
|
-
Then spirit
|
73
|
-
|
74
|
-
@two
|
75
|
-
Scenario: _why
|
76
|
-
Given chunky
|
77
|
-
Then bacon
|
78
|
-
|
79
|
-
@three @four
|
80
|
-
Scenario Outline: Life
|
81
|
-
Given some <boredom>
|
82
|
-
|
83
|
-
@five
|
84
|
-
Examples: Real life
|
85
|
-
|boredom|
|
86
|
-
|airport|
|
87
|
-
|meeting|
|
88
|
-
|
89
|
-
Scenario: who stole my mojo?
|
90
|
-
When I was
|
91
|
-
|asleep|
|
92
|
-
And so
|
93
|
-
\"\"\"plaintext
|
94
|
-
innocent
|
95
|
-
\"\"\"
|
96
|
-
|
97
|
-
# The
|
98
|
-
Scenario Outline: with
|
99
|
-
# all
|
100
|
-
Then nice
|
101
|
-
|
102
|
-
# comments
|
103
|
-
# everywhere
|
104
|
-
Examples: An example
|
105
|
-
# I mean
|
106
|
-
| partout |
|
107
|
-
"""
|
108
|
-
Then the outputted JSON should be:
|
109
|
-
"""
|
110
|
-
[
|
111
|
-
{
|
112
|
-
"uri": "test.feature",
|
113
|
-
"description": "",
|
114
|
-
"elements": [
|
115
|
-
{
|
116
|
-
"description": "",
|
117
|
-
"keyword": "Scenario",
|
118
|
-
"line": 4,
|
119
|
-
"id": "oh-hai;fujin",
|
120
|
-
"name": "Fujin",
|
121
|
-
"steps": [
|
122
|
-
{
|
123
|
-
"keyword": "Given ",
|
124
|
-
"line": 5,
|
125
|
-
"name": "wind"
|
126
|
-
},
|
127
|
-
{
|
128
|
-
"keyword": "Then ",
|
129
|
-
"line": 6,
|
130
|
-
"name": "spirit"
|
131
|
-
}
|
132
|
-
],
|
133
|
-
"type": "scenario"
|
134
|
-
},
|
135
|
-
{
|
136
|
-
"description": "",
|
137
|
-
"keyword": "Scenario",
|
138
|
-
"line": 9,
|
139
|
-
"id": "oh-hai;-why",
|
140
|
-
"name": "_why",
|
141
|
-
"steps": [
|
142
|
-
{
|
143
|
-
"keyword": "Given ",
|
144
|
-
"line": 10,
|
145
|
-
"name": "chunky"
|
146
|
-
},
|
147
|
-
{
|
148
|
-
"keyword": "Then ",
|
149
|
-
"line": 11,
|
150
|
-
"name": "bacon"
|
151
|
-
}
|
152
|
-
],
|
153
|
-
"tags": [
|
154
|
-
{
|
155
|
-
"line": 8,
|
156
|
-
"name": "@two"
|
157
|
-
}
|
158
|
-
],
|
159
|
-
"type": "scenario"
|
160
|
-
},
|
161
|
-
{
|
162
|
-
"description": "",
|
163
|
-
"examples": [
|
164
|
-
{
|
165
|
-
"description": "",
|
166
|
-
"keyword": "Examples",
|
167
|
-
"line": 18,
|
168
|
-
"id": "oh-hai;life;real-life",
|
169
|
-
"name": "Real life",
|
170
|
-
"rows": [
|
171
|
-
{
|
172
|
-
"id": "oh-hai;life;real-life;1",
|
173
|
-
"cells": [
|
174
|
-
"boredom"
|
175
|
-
],
|
176
|
-
"line": 19
|
177
|
-
},
|
178
|
-
{
|
179
|
-
"id": "oh-hai;life;real-life;2",
|
180
|
-
"cells": [
|
181
|
-
"airport"
|
182
|
-
],
|
183
|
-
"line": 20
|
184
|
-
},
|
185
|
-
{
|
186
|
-
"id": "oh-hai;life;real-life;3",
|
187
|
-
"cells": [
|
188
|
-
"meeting"
|
189
|
-
],
|
190
|
-
"line": 21
|
191
|
-
}
|
192
|
-
],
|
193
|
-
"tags": [
|
194
|
-
{
|
195
|
-
"line": 17,
|
196
|
-
"name": "@five"
|
197
|
-
}
|
198
|
-
]
|
199
|
-
}
|
200
|
-
],
|
201
|
-
"keyword": "Scenario Outline",
|
202
|
-
"line": 14,
|
203
|
-
"id": "oh-hai;life",
|
204
|
-
"name": "Life",
|
205
|
-
"steps": [
|
206
|
-
{
|
207
|
-
"keyword": "Given ",
|
208
|
-
"line": 15,
|
209
|
-
"name": "some <boredom>"
|
210
|
-
}
|
211
|
-
],
|
212
|
-
"tags": [
|
213
|
-
{
|
214
|
-
"line": 13,
|
215
|
-
"name": "@three"
|
216
|
-
},
|
217
|
-
{
|
218
|
-
"line": 13,
|
219
|
-
"name": "@four"
|
220
|
-
}
|
221
|
-
],
|
222
|
-
"type": "scenario_outline"
|
223
|
-
},
|
224
|
-
{
|
225
|
-
"description": "",
|
226
|
-
"keyword": "Scenario",
|
227
|
-
"line": 23,
|
228
|
-
"id": "oh-hai;who-stole-my-mojo?",
|
229
|
-
"name": "who stole my mojo?",
|
230
|
-
"steps": [
|
231
|
-
{
|
232
|
-
"keyword": "When ",
|
233
|
-
"line": 24,
|
234
|
-
"name": "I was",
|
235
|
-
"rows": [
|
236
|
-
{
|
237
|
-
"cells": [
|
238
|
-
"asleep"
|
239
|
-
],
|
240
|
-
"line": 25
|
241
|
-
}
|
242
|
-
]
|
243
|
-
},
|
244
|
-
{
|
245
|
-
"doc_string": {
|
246
|
-
"content_type": "plaintext",
|
247
|
-
"line": 27,
|
248
|
-
"value": "innocent"
|
249
|
-
},
|
250
|
-
"keyword": "And ",
|
251
|
-
"line": 26,
|
252
|
-
"name": "so"
|
253
|
-
}
|
254
|
-
],
|
255
|
-
"type": "scenario"
|
256
|
-
},
|
257
|
-
{
|
258
|
-
"comments": [
|
259
|
-
{
|
260
|
-
"line": 31,
|
261
|
-
"value": "# The"
|
262
|
-
}
|
263
|
-
],
|
264
|
-
"description": "",
|
265
|
-
"examples": [
|
266
|
-
{
|
267
|
-
"comments": [
|
268
|
-
{
|
269
|
-
"line": 36,
|
270
|
-
"value": "# comments"
|
271
|
-
},
|
272
|
-
{
|
273
|
-
"line": 37,
|
274
|
-
"value": "# everywhere"
|
275
|
-
}
|
276
|
-
],
|
277
|
-
"description": "",
|
278
|
-
"keyword": "Examples",
|
279
|
-
"line": 38,
|
280
|
-
"id": "oh-hai;with;an-example",
|
281
|
-
"name": "An example",
|
282
|
-
"rows": [
|
283
|
-
{
|
284
|
-
"id": "oh-hai;with;an-example;1",
|
285
|
-
"cells": [
|
286
|
-
"partout"
|
287
|
-
],
|
288
|
-
"comments": [
|
289
|
-
{
|
290
|
-
"line": 39,
|
291
|
-
"value": "# I mean"
|
292
|
-
}
|
293
|
-
],
|
294
|
-
"line": 40
|
295
|
-
}
|
296
|
-
]
|
297
|
-
}
|
298
|
-
],
|
299
|
-
"keyword": "Scenario Outline",
|
300
|
-
"line": 32,
|
301
|
-
"id": "oh-hai;with",
|
302
|
-
"name": "with",
|
303
|
-
"steps": [
|
304
|
-
{
|
305
|
-
"comments": [
|
306
|
-
{
|
307
|
-
"line": 33,
|
308
|
-
"value": "# all"
|
309
|
-
}
|
310
|
-
],
|
311
|
-
"keyword": "Then ",
|
312
|
-
"line": 34,
|
313
|
-
"name": "nice"
|
314
|
-
}
|
315
|
-
],
|
316
|
-
"type": "scenario_outline"
|
317
|
-
}
|
318
|
-
],
|
319
|
-
"keyword": "Feature",
|
320
|
-
"line": 2,
|
321
|
-
"id": "oh-hai",
|
322
|
-
"name": "OH HAI",
|
323
|
-
"tags": [
|
324
|
-
{
|
325
|
-
"line": 1,
|
326
|
-
"name": "@one"
|
327
|
-
}
|
328
|
-
]
|
329
|
-
}
|
330
|
-
]
|
331
|
-
"""
|
332
|
-
|
333
|
-
Scenario: Feature with Background
|
334
|
-
Given the following text is parsed:
|
335
|
-
"""
|
336
|
-
Feature: Kjapp
|
337
|
-
|
338
|
-
Background: No idea what Kjapp means
|
339
|
-
Given I Google it
|
340
|
-
|
341
|
-
# Writing JSON by hand sucks
|
342
|
-
Scenario:
|
343
|
-
Then I think it means "fast"
|
344
|
-
"""
|
345
|
-
Then the outputted JSON should be:
|
346
|
-
"""
|
347
|
-
[
|
348
|
-
{
|
349
|
-
"uri": "test.feature",
|
350
|
-
"keyword": "Feature",
|
351
|
-
"name": "Kjapp",
|
352
|
-
"id": "kjapp",
|
353
|
-
"description": "",
|
354
|
-
"line": 1,
|
355
|
-
"elements": [
|
356
|
-
{
|
357
|
-
"type": "background",
|
358
|
-
"keyword": "Background",
|
359
|
-
"line": 3,
|
360
|
-
"name": "No idea what Kjapp means",
|
361
|
-
"description": "",
|
362
|
-
"steps": [
|
363
|
-
{
|
364
|
-
"keyword": "Given ",
|
365
|
-
"line": 4,
|
366
|
-
"name": "I Google it"
|
367
|
-
}
|
368
|
-
]
|
369
|
-
},
|
370
|
-
{
|
371
|
-
"type": "scenario",
|
372
|
-
"comments": [{"value": "# Writing JSON by hand sucks", "line": 6}],
|
373
|
-
"keyword": "Scenario",
|
374
|
-
"id": "kjapp;",
|
375
|
-
"name": "",
|
376
|
-
"description": "",
|
377
|
-
"line": 7,
|
378
|
-
"steps": [
|
379
|
-
{
|
380
|
-
"keyword": "Then ",
|
381
|
-
"name": "I think it means \"fast\"",
|
382
|
-
"line": 8
|
383
|
-
}
|
384
|
-
]
|
385
|
-
}
|
386
|
-
]
|
387
|
-
}
|
388
|
-
]
|
389
|
-
"""
|
390
|
-
|
391
|
-
Scenario: Feature with a description
|
392
|
-
|
393
|
-
We want people to be able to put markdown formatting into their descriptions
|
394
|
-
but this means we need to respect whitespace at the start and end of lines
|
395
|
-
in the description.
|
396
|
-
|
397
|
-
Pay close attention to the whitespace in this example.
|
398
|
-
|
399
|
-
Given the following text is parsed:
|
400
|
-
"""
|
401
|
-
Feature: Foo
|
402
|
-
one line
|
403
|
-
another line
|
404
|
-
|
405
|
-
some pre-formatted stuff
|
406
|
-
|
407
|
-
Background: b name
|
408
|
-
test
|
409
|
-
test
|
410
|
-
|
411
|
-
Scenario: s name
|
412
|
-
test
|
413
|
-
test
|
414
|
-
|
415
|
-
Scenario Outline: s o name
|
416
|
-
test
|
417
|
-
test
|
418
|
-
|
419
|
-
Given <foo>
|
420
|
-
|
421
|
-
Examples: e name
|
422
|
-
test
|
423
|
-
test
|
424
|
-
| foo |
|
425
|
-
| table |
|
426
|
-
"""
|
427
|
-
Then the outputted JSON should be:
|
428
|
-
"""
|
429
|
-
[
|
430
|
-
{
|
431
|
-
"uri": "test.feature",
|
432
|
-
"keyword": "Feature",
|
433
|
-
"id": "foo",
|
434
|
-
"name": "Foo",
|
435
|
-
"description": "one line \nanother line \n\n some pre-formatted stuff",
|
436
|
-
"line": 1,
|
437
|
-
"elements": [
|
438
|
-
{
|
439
|
-
"description": " test \n test",
|
440
|
-
"keyword": "Background",
|
441
|
-
"line": 7,
|
442
|
-
"name": "b name",
|
443
|
-
"type": "background"
|
444
|
-
},
|
445
|
-
{
|
446
|
-
"description": " test \n test",
|
447
|
-
"keyword": "Scenario",
|
448
|
-
"line": 11,
|
449
|
-
"id": "foo;s-name",
|
450
|
-
"name": "s name",
|
451
|
-
"type": "scenario"
|
452
|
-
},
|
453
|
-
{
|
454
|
-
"description": " test \n test",
|
455
|
-
"examples": [
|
456
|
-
{
|
457
|
-
"description": " test \n test",
|
458
|
-
"keyword": "Examples",
|
459
|
-
"line": 21,
|
460
|
-
"id": "foo;s-o-name;e-name",
|
461
|
-
"name": "e name",
|
462
|
-
"rows": [
|
463
|
-
{
|
464
|
-
"id": "foo;s-o-name;e-name;1",
|
465
|
-
"cells": [
|
466
|
-
"foo"
|
467
|
-
],
|
468
|
-
"line": 24
|
469
|
-
},
|
470
|
-
{
|
471
|
-
"id": "foo;s-o-name;e-name;2",
|
472
|
-
"cells": [
|
473
|
-
"table"
|
474
|
-
],
|
475
|
-
"line": 25
|
476
|
-
}
|
477
|
-
]
|
478
|
-
}
|
479
|
-
],
|
480
|
-
"keyword": "Scenario Outline",
|
481
|
-
"line": 15,
|
482
|
-
"id": "foo;s-o-name",
|
483
|
-
"name": "s o name",
|
484
|
-
"steps": [
|
485
|
-
{
|
486
|
-
"keyword": "Given ",
|
487
|
-
"line": 19,
|
488
|
-
"name": "<foo>"
|
489
|
-
}
|
490
|
-
],
|
491
|
-
"type": "scenario_outline"
|
492
|
-
}
|
493
|
-
]
|
494
|
-
}
|
495
|
-
]
|
496
|
-
"""
|
497
|
-
|
498
|
-
|