benhamill-gherkin 2.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. data/.gitattributes +2 -0
  2. data/.gitignore +11 -0
  3. data/.mailmap +2 -0
  4. data/.rspec +1 -0
  5. data/.rvmrc +1 -0
  6. data/Gemfile +7 -0
  7. data/History.txt +363 -0
  8. data/LICENSE +20 -0
  9. data/README.rdoc +149 -0
  10. data/Rakefile +19 -0
  11. data/VERSION +1 -0
  12. data/build_native_gems.sh +8 -0
  13. data/cucumber.yml +3 -0
  14. data/features/escaped_pipes.feature +8 -0
  15. data/features/feature_parser.feature +237 -0
  16. data/features/json_formatter.feature +377 -0
  17. data/features/json_parser.feature +318 -0
  18. data/features/native_lexer.feature +19 -0
  19. data/features/parser_with_native_lexer.feature +205 -0
  20. data/features/pretty_formatter.feature +15 -0
  21. data/features/step_definitions/eyeball_steps.rb +3 -0
  22. data/features/step_definitions/gherkin_steps.rb +29 -0
  23. data/features/step_definitions/json_formatter_steps.rb +28 -0
  24. data/features/step_definitions/json_parser_steps.rb +20 -0
  25. data/features/step_definitions/pretty_formatter_steps.rb +84 -0
  26. data/features/steps_parser.feature +46 -0
  27. data/features/support/env.rb +38 -0
  28. data/gherkin.gemspec +61 -0
  29. data/ikvm/.gitignore +3 -0
  30. data/java/.gitignore +5 -0
  31. data/java/src/main/java/gherkin/lexer/i18n/.gitignore +1 -0
  32. data/java/src/main/resources/gherkin/.gitignore +1 -0
  33. data/js/lib/gherkin/lexer/i18n/ar.js +1094 -0
  34. data/js/lib/gherkin/lexer/i18n/bg.js +1308 -0
  35. data/js/lib/gherkin/lexer/i18n/ca.js +1236 -0
  36. data/js/lib/gherkin/lexer/i18n/cs.js +1090 -0
  37. data/js/lib/gherkin/lexer/i18n/cy_gb.js +958 -0
  38. data/js/lib/gherkin/lexer/i18n/da.js +974 -0
  39. data/js/lib/gherkin/lexer/i18n/de.js +1082 -0
  40. data/js/lib/gherkin/lexer/i18n/en.js +965 -0
  41. data/js/lib/gherkin/lexer/i18n/en_au.js +902 -0
  42. data/js/lib/gherkin/lexer/i18n/en_lol.js +859 -0
  43. data/js/lib/gherkin/lexer/i18n/en_pirate.js +1136 -0
  44. data/js/lib/gherkin/lexer/i18n/en_scouse.js +1289 -0
  45. data/js/lib/gherkin/lexer/i18n/en_tx.js +942 -0
  46. data/js/lib/gherkin/lexer/i18n/eo.js +916 -0
  47. data/js/lib/gherkin/lexer/i18n/es.js +1049 -0
  48. data/js/lib/gherkin/lexer/i18n/et.js +915 -0
  49. data/js/lib/gherkin/lexer/i18n/fi.js +894 -0
  50. data/js/lib/gherkin/lexer/i18n/fr.js +1116 -0
  51. data/js/lib/gherkin/lexer/i18n/he.js +1044 -0
  52. data/js/lib/gherkin/lexer/i18n/hr.js +994 -0
  53. data/js/lib/gherkin/lexer/i18n/hu.js +1043 -0
  54. data/js/lib/gherkin/lexer/i18n/id.js +884 -0
  55. data/js/lib/gherkin/lexer/i18n/it.js +1007 -0
  56. data/js/lib/gherkin/lexer/i18n/ja.js +1344 -0
  57. data/js/lib/gherkin/lexer/i18n/ko.js +1028 -0
  58. data/js/lib/gherkin/lexer/i18n/lt.js +972 -0
  59. data/js/lib/gherkin/lexer/i18n/lu.js +1057 -0
  60. data/js/lib/gherkin/lexer/i18n/lv.js +1092 -0
  61. data/js/lib/gherkin/lexer/i18n/nl.js +1036 -0
  62. data/js/lib/gherkin/lexer/i18n/no.js +986 -0
  63. data/js/lib/gherkin/lexer/i18n/pl.js +1140 -0
  64. data/js/lib/gherkin/lexer/i18n/pt.js +1000 -0
  65. data/js/lib/gherkin/lexer/i18n/ro.js +1089 -0
  66. data/js/lib/gherkin/lexer/i18n/ru.js +1560 -0
  67. data/js/lib/gherkin/lexer/i18n/sk.js +972 -0
  68. data/js/lib/gherkin/lexer/i18n/sr_cyrl.js +1728 -0
  69. data/js/lib/gherkin/lexer/i18n/sr_latn.js +1220 -0
  70. data/js/lib/gherkin/lexer/i18n/sv.js +997 -0
  71. data/js/lib/gherkin/lexer/i18n/tr.js +1014 -0
  72. data/js/lib/gherkin/lexer/i18n/uk.js +1572 -0
  73. data/js/lib/gherkin/lexer/i18n/uz.js +1302 -0
  74. data/js/lib/gherkin/lexer/i18n/vi.js +1124 -0
  75. data/js/lib/gherkin/lexer/i18n/zh_cn.js +902 -0
  76. data/js/lib/gherkin/lexer/i18n/zh_tw.js +940 -0
  77. data/lib/.gitignore +4 -0
  78. data/lib/gherkin.rb +2 -0
  79. data/lib/gherkin/c_lexer.rb +17 -0
  80. data/lib/gherkin/formatter/ansi_escapes.rb +95 -0
  81. data/lib/gherkin/formatter/argument.rb +16 -0
  82. data/lib/gherkin/formatter/escaping.rb +15 -0
  83. data/lib/gherkin/formatter/filter_formatter.rb +136 -0
  84. data/lib/gherkin/formatter/hashable.rb +19 -0
  85. data/lib/gherkin/formatter/json_formatter.rb +102 -0
  86. data/lib/gherkin/formatter/line_filter.rb +26 -0
  87. data/lib/gherkin/formatter/model.rb +236 -0
  88. data/lib/gherkin/formatter/pretty_formatter.rb +243 -0
  89. data/lib/gherkin/formatter/regexp_filter.rb +21 -0
  90. data/lib/gherkin/formatter/step_printer.rb +17 -0
  91. data/lib/gherkin/formatter/tag_count_formatter.rb +47 -0
  92. data/lib/gherkin/formatter/tag_filter.rb +19 -0
  93. data/lib/gherkin/i18n.rb +175 -0
  94. data/lib/gherkin/i18n.yml +588 -0
  95. data/lib/gherkin/json_parser.rb +137 -0
  96. data/lib/gherkin/lexer/i18n_lexer.rb +47 -0
  97. data/lib/gherkin/listener/event.rb +45 -0
  98. data/lib/gherkin/listener/formatter_listener.rb +113 -0
  99. data/lib/gherkin/native.rb +7 -0
  100. data/lib/gherkin/native/ikvm.rb +55 -0
  101. data/lib/gherkin/native/java.rb +55 -0
  102. data/lib/gherkin/native/null.rb +9 -0
  103. data/lib/gherkin/parser/meta.txt +5 -0
  104. data/lib/gherkin/parser/parser.rb +164 -0
  105. data/lib/gherkin/parser/root.txt +11 -0
  106. data/lib/gherkin/parser/steps.txt +4 -0
  107. data/lib/gherkin/rb_lexer.rb +8 -0
  108. data/lib/gherkin/rb_lexer/.gitignore +1 -0
  109. data/lib/gherkin/rb_lexer/README.rdoc +8 -0
  110. data/lib/gherkin/rubify.rb +24 -0
  111. data/lib/gherkin/tag_expression.rb +62 -0
  112. data/lib/gherkin/version.rb +3 -0
  113. data/ragel/i18n/.gitignore +1 -0
  114. data/ragel/lexer.c.rl.erb +439 -0
  115. data/ragel/lexer.java.rl.erb +208 -0
  116. data/ragel/lexer.rb.rl.erb +167 -0
  117. data/ragel/lexer_common.rl.erb +50 -0
  118. data/spec/gherkin/c_lexer_spec.rb +21 -0
  119. data/spec/gherkin/fixtures/1.feature +8 -0
  120. data/spec/gherkin/fixtures/comments_in_table.feature +9 -0
  121. data/spec/gherkin/fixtures/complex.feature +45 -0
  122. data/spec/gherkin/fixtures/complex.json +143 -0
  123. data/spec/gherkin/fixtures/complex_for_filtering.feature +60 -0
  124. data/spec/gherkin/fixtures/complex_with_tags.feature +61 -0
  125. data/spec/gherkin/fixtures/dos_line_endings.feature +45 -0
  126. data/spec/gherkin/fixtures/hantu_pisang.feature +35 -0
  127. data/spec/gherkin/fixtures/i18n_fr.feature +14 -0
  128. data/spec/gherkin/fixtures/i18n_no.feature +7 -0
  129. data/spec/gherkin/fixtures/i18n_zh-CN.feature +9 -0
  130. data/spec/gherkin/fixtures/scenario_outline_with_tags.feature +13 -0
  131. data/spec/gherkin/fixtures/scenario_without_steps.feature +5 -0
  132. data/spec/gherkin/fixtures/simple_with_comments.feature +7 -0
  133. data/spec/gherkin/fixtures/simple_with_tags.feature +11 -0
  134. data/spec/gherkin/fixtures/with_bom.feature +3 -0
  135. data/spec/gherkin/formatter/ansi_escapes_spec.rb +19 -0
  136. data/spec/gherkin/formatter/filter_formatter_spec.rb +165 -0
  137. data/spec/gherkin/formatter/model_spec.rb +28 -0
  138. data/spec/gherkin/formatter/pretty_formatter_spec.rb +158 -0
  139. data/spec/gherkin/formatter/spaces.feature +9 -0
  140. data/spec/gherkin/formatter/step_printer_spec.rb +55 -0
  141. data/spec/gherkin/formatter/tabs.feature +9 -0
  142. data/spec/gherkin/formatter/tag_count_formatter_spec.rb +30 -0
  143. data/spec/gherkin/i18n_spec.rb +152 -0
  144. data/spec/gherkin/java_lexer_spec.rb +20 -0
  145. data/spec/gherkin/java_libs.rb +20 -0
  146. data/spec/gherkin/json_parser_spec.rb +113 -0
  147. data/spec/gherkin/lexer/i18n_lexer_spec.rb +43 -0
  148. data/spec/gherkin/output_stream_string_io.rb +20 -0
  149. data/spec/gherkin/parser/parser_spec.rb +16 -0
  150. data/spec/gherkin/rb_lexer_spec.rb +19 -0
  151. data/spec/gherkin/sexp_recorder.rb +56 -0
  152. data/spec/gherkin/shared/lexer_group.rb +593 -0
  153. data/spec/gherkin/shared/py_string_group.rb +153 -0
  154. data/spec/gherkin/shared/row_group.rb +125 -0
  155. data/spec/gherkin/shared/tags_group.rb +54 -0
  156. data/spec/gherkin/tag_expression_spec.rb +137 -0
  157. data/spec/spec_helper.rb +69 -0
  158. data/tasks/bench.rake +184 -0
  159. data/tasks/bench/feature_builder.rb +49 -0
  160. data/tasks/bench/generated/.gitignore +1 -0
  161. data/tasks/bench/null_listener.rb +4 -0
  162. data/tasks/compile.rake +102 -0
  163. data/tasks/cucumber.rake +20 -0
  164. data/tasks/gems.rake +35 -0
  165. data/tasks/ikvm.rake +79 -0
  166. data/tasks/ragel_task.rb +70 -0
  167. data/tasks/rdoc.rake +9 -0
  168. data/tasks/release.rake +30 -0
  169. data/tasks/rspec.rake +8 -0
  170. metadata +609 -0
@@ -0,0 +1,8 @@
1
+ Feature: Logging in
2
+ So that I can be myself
3
+ # Comment
4
+ Scenario: Anonymous user can get a login form.
5
+ Scenery here
6
+
7
+ @tag
8
+ Scenario: Another one
@@ -0,0 +1,9 @@
1
+ Feature: x
2
+
3
+ Scenario Outline: x
4
+ Then x is <state>
5
+
6
+ Examples:
7
+ | state |
8
+ # comment
9
+ | 1 |
@@ -0,0 +1,45 @@
1
+ #Comment on line 1
2
+ #Comment on line 2
3
+ @tag1 @tag2
4
+ Feature: Feature Text
5
+ In order to test multiline forms
6
+ As a ragel writer
7
+ I need to check for complex combinations
8
+
9
+ #Comment on line 9
10
+
11
+ #Comment on line 11
12
+
13
+ Background:
14
+ Given this is a background step
15
+ And this is another one
16
+
17
+ @tag3 @tag4
18
+ Scenario: Reading a Scenario
19
+ Given there is a step
20
+ But not another step
21
+
22
+ @tag3
23
+ Scenario: Reading a second scenario
24
+ With two lines of text
25
+ #Comment on line 24
26
+ Given a third step with a table
27
+ |a|b|
28
+ |c|d|
29
+ |e|f|
30
+ And I am still testing things
31
+ |g|h|
32
+ |e|r|
33
+ |k|i|
34
+ |n||
35
+ And I am done testing these tables
36
+ #Comment on line 29
37
+ Then I am happy
38
+
39
+ Scenario: Hammerzeit
40
+ Given All work and no play
41
+ """
42
+ Makes Homer something something
43
+ And something else
44
+ """
45
+ Then crazy
@@ -0,0 +1,143 @@
1
+ {
2
+ "name": "Feature Text",
3
+ "keyword": "Feature",
4
+ "description": "In order to test multiline forms",
5
+ "tags": [
6
+ {"name": "@tag1"},
7
+ {"name": "@tag2"}
8
+ ],
9
+ "elements": [
10
+ { "type": "background",
11
+ "description": "",
12
+ "name": "",
13
+ "keyword": "Background",
14
+ "steps": [
15
+ { "name": "this is a background step",
16
+ "keyword": "Given " },
17
+ { "name": "this is another one",
18
+ "keyword": "When ",
19
+ "line": 412 }
20
+ ]
21
+ },
22
+ { "type": "scenario_outline",
23
+ "keyword": "Scenario Outline",
24
+ "name": "An Scenario Outline",
25
+ "description": "",
26
+ "tags": [
27
+ {"name": "@foo"}
28
+ ],
29
+ "steps": [
30
+ { "name": "A step with a table",
31
+ "keyword": "Given ",
32
+ "multiline_arg": {
33
+ "type": "table",
34
+ "value" : [
35
+ {"cells":
36
+ [ "a","row","for","a","step" ]
37
+ }
38
+ ]
39
+ }
40
+ }
41
+ ],
42
+ "examples": [
43
+ {
44
+ "name": "Sweet Example",
45
+ "keyword": "Examples",
46
+ "description": "",
47
+ "rows" : [
48
+ {"cells" :
49
+ [ "Fill","In" ]
50
+ },
51
+ {"cells" :
52
+ [ "The","Blanks" ]
53
+ }
54
+ ],
55
+ "tags" : [ {"name": "@exampletag"} ]
56
+ }
57
+ ]
58
+ },
59
+ { "type" : "scenario",
60
+ "keyword": "Scenario",
61
+ "name" : "Reading a Scenario",
62
+ "description": "",
63
+ "tags" : [
64
+ {"name": "@tag3"},
65
+ {"name": "@tag4"}
66
+ ],
67
+ "steps" : [
68
+ { "name" : "there is a step",
69
+ "keyword": "Given "},
70
+ { "name" : "not another step",
71
+ "keyword": "But " }
72
+ ]
73
+ },
74
+ { "type" : "scenario",
75
+ "keyword": "Scenario",
76
+ "name" : "Reading a second scenario",
77
+ "description": "With two lines of text",
78
+ "tags" : [ {"name": "@tag3"} ],
79
+ "steps" : [
80
+ { "name" : "a third step with a table",
81
+ "keyword": "Given ",
82
+ "multiline_arg": {
83
+ "type": "table",
84
+ "value": [
85
+ {
86
+ "cells" : [ "a","b" ],
87
+ "line" : 987
88
+ },
89
+ { "cells" :
90
+ [ "c","d" ]
91
+ },
92
+ { "cells" :
93
+ [ "e", "f" ]
94
+ }
95
+ ]
96
+ }
97
+ },
98
+ { "name" : "I am still testing things",
99
+ "keyword": "Given ",
100
+ "multiline_arg": {
101
+ "type": "table",
102
+ "value": [
103
+ { "cells" :
104
+ [ "g","h" ]
105
+ },
106
+ { "cells" :
107
+ [ "e","r" ]
108
+ },
109
+ { "cells" :
110
+ [ "k", "i" ]
111
+ },
112
+ { "cells" :
113
+ [ "n", "" ]
114
+ }
115
+ ]
116
+ }
117
+ },
118
+ { "name" : "I am done testing these tables",
119
+ "keyword": "Given " },
120
+ { "name" : "I am happy",
121
+ "keyword": "Given " }
122
+ ]
123
+ },
124
+ { "type" : "scenario",
125
+ "keyword": "Scenario",
126
+ "name" : "Hammerzeit",
127
+ "description": "",
128
+ "steps" : [
129
+ { "name" : "All work and no play",
130
+ "keyword": "Given ",
131
+ "multiline_arg": {
132
+ "type": "py_string",
133
+ "value": "Makes Homer something something\nAnd something else",
134
+ "line": 777
135
+ }
136
+ },
137
+ { "name" : "crazy",
138
+ "keyword": "Given " }
139
+ ]
140
+ }
141
+ ]
142
+ }
143
+
@@ -0,0 +1,60 @@
1
+ #Comment on line 1
2
+ #Comment on line 2
3
+ @tag1 @tag2
4
+ Feature: Feature Text
5
+ In order to test multiline forms
6
+ As a ragel writer
7
+ I need to check for complex combinations
8
+
9
+ #Comment on line 9
10
+ #Comment on line 11
11
+ Background:
12
+ Given this is a background step
13
+ And this is another one
14
+
15
+ @tag3 @tag4
16
+ Scenario: Reading a Scenario
17
+ Given there is a step
18
+ But not another step
19
+
20
+ @tag3
21
+ Scenario: Reading a second scenario
22
+ With two lines of text
23
+
24
+ #Comment on line 24
25
+ Given a third step with a table
26
+ | a | b |
27
+ | c | d |
28
+ | e | f |
29
+ And I am still testing things
30
+ And I am done testing these tables
31
+ #Comment on line 29
32
+ Then I am happy
33
+ | g | h |
34
+ | e | r |
35
+ | k | i |
36
+ | n | |
37
+
38
+ Scenario: Hammerzeit XX
39
+ Given All work and no play
40
+ Then crazy
41
+ """
42
+ Makes Homer something something
43
+ And something else
44
+ """
45
+
46
+ @more
47
+ Scenario Outline: More
48
+ Given Some <whaaa>
49
+
50
+ @neat
51
+ Examples: Neato XX
52
+ | whaa |
53
+ | neat |
54
+ | beat |
55
+
56
+ @hamster
57
+ Examples: Rodents
58
+ | whaa |
59
+ | hammy |
60
+ | mousy |
@@ -0,0 +1,61 @@
1
+ #Comment on line 1
2
+ #Comment on line 2
3
+ @tag1 @tag2
4
+ Feature: Feature Text
5
+ In order to test multiline forms
6
+ As a ragel writer
7
+ I need to check for complex combinations
8
+
9
+ #Comment on line 9
10
+
11
+ #Comment on line 11
12
+
13
+ Background:
14
+ Given this is a background step
15
+ And this is another one
16
+
17
+ @tag3 @tag4
18
+ Scenario: Reading a Scenario
19
+ Given there is a step
20
+ But not another step
21
+
22
+ @tag3
23
+ Scenario: Reading a second scenario
24
+ With two lines of text
25
+ #Comment on line 24
26
+ Given a third step with a table
27
+ |a|b|
28
+ |c|d|
29
+ |e|f|
30
+ And I am still testing things
31
+ |g|h|
32
+ |e|r|
33
+ |k|i|
34
+ |n||
35
+ And I am done testing these tables
36
+ #Comment on line 29
37
+ Then I am happy
38
+
39
+ Scenario: Hammerzeit
40
+ Given All work and no play
41
+ """
42
+ Makes Homer something something
43
+ And something else
44
+ """
45
+ Then crazy
46
+
47
+ @more
48
+ Scenario Outline: More
49
+ Given Some <whaaa>
50
+
51
+ @neat
52
+ Examples: Neato
53
+ |whaa|
54
+ |neat|
55
+ |beat|
56
+
57
+ @hamster
58
+ Examples: Rodents
59
+ |whaa|
60
+ |hammy|
61
+ |mousy|
@@ -0,0 +1,45 @@
1
+ #Comment on line 1
2
+ #Comment on line 2
3
+ @tag1 @tag2
4
+ Feature: Feature Text
5
+ In order to test multiline forms
6
+ As a ragel writer
7
+ I need to check for complex combinations
8
+
9
+ #Comment on line 9
10
+
11
+ #Comment on line 11
12
+
13
+ Background:
14
+ Given this is a background step
15
+ And this is another one
16
+
17
+ @tag3 @tag4
18
+ Scenario: Reading a Scenario
19
+ Given there is a step
20
+ But not another step
21
+
22
+ @tag3
23
+ Scenario: Reading a second scenario
24
+ With two lines of text
25
+ #Comment on line 24
26
+ Given a third step with a table
27
+ |a|b|
28
+ |c|d|
29
+ |e|f|
30
+ And I am still testing things
31
+ |g|h|
32
+ |e|r|
33
+ |k|i|
34
+ |n||
35
+ And I am done testing these tables
36
+ #Comment on line 29
37
+ Then I am happy
38
+
39
+ Scenario: Hammerzeit
40
+ Given All work and no play
41
+ """
42
+ Makes Homer something something
43
+ And something else
44
+ """
45
+ Then crazy
@@ -0,0 +1,35 @@
1
+ Feature: search examples
2
+
3
+ Background: The background
4
+ Given passing without a table
5
+
6
+ Scenario: should match Hantu Pisang
7
+ Given passing without a table
8
+
9
+ Scenario: Ignore me
10
+ Given failing without a table
11
+
12
+ Scenario Outline: Ignore me
13
+ Given <state> without a table
14
+
15
+ Examples:
16
+ | state |
17
+ | 1111111 |
18
+
19
+ Scenario Outline: Hantu Pisang match
20
+ Given <state> without a table
21
+
22
+ Examples:
23
+ | state |
24
+ | 2222222 |
25
+
26
+ Scenario Outline: no match in name but in examples
27
+ Given <state> without a table
28
+
29
+ Examples: Hantu Pisang
30
+ | state |
31
+ | 3333333 |
32
+
33
+ Examples: Ignore me
34
+ | state |
35
+ | 4444444 |
@@ -0,0 +1,14 @@
1
+ #language:fr
2
+ Fonctionnalité: Addition
3
+ Plan du scénario: Addition de produits dérivés
4
+ Soit une calculatrice
5
+ Etant donné qu'on tape <a>
6
+ Et qu'on tape <b>
7
+ Lorsqu'on tape additionner
8
+ Alors le résultat doit être <somme>
9
+
10
+ Exemples:
11
+ | a | b | somme |
12
+ | 2 | 2 | 4 |
13
+ | 2 | 3 | 5 |
14
+
@@ -0,0 +1,7 @@
1
+ #language:no
2
+ Egenskap: i18n support
3
+
4
+ Scenario: Parsing many languages
5
+ Gitt Gherkin supports many languages
6
+ Når Norwegian keywords are parsed
7
+ Så they should be recognized
@@ -0,0 +1,9 @@
1
+ #language:zh-CN
2
+ 功能:加法
3
+
4
+ 场景: 两个数相加
5
+ 假如我已经在计算器里输入6
6
+ 而且我已经在计算器里输入7
7
+ 当我按相加按钮
8
+ 那么我应该在屏幕上看到的结果是13
9
+