kosmas58-cucumber 0.1.16.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (271) hide show
  1. data/History.txt +389 -0
  2. data/License.txt +20 -0
  3. data/Manifest.txt +270 -0
  4. data/README.txt +4 -0
  5. data/Rakefile +9 -0
  6. data/bin/cucumber +6 -0
  7. data/config/hoe.rb +70 -0
  8. data/config/requirements.rb +15 -0
  9. data/cucumber.yml +3 -0
  10. data/examples/calculator_ruby_features/Rakefile +6 -0
  11. data/examples/calculator_ruby_features/features/addition.rb +39 -0
  12. data/examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb +43 -0
  13. data/examples/cs/README.textile +1 -0
  14. data/examples/cs/Rakefile +12 -0
  15. data/examples/cs/compile.bat +1 -0
  16. data/examples/cs/features/addition.feature +16 -0
  17. data/examples/cs/features/step_definitons/calculator_steps.rb +19 -0
  18. data/examples/cs/src/demo/Calculator.cs +20 -0
  19. data/examples/dos_line_endings/Rakefile +6 -0
  20. data/examples/dos_line_endings/features/dos_line_endings.feature +9 -0
  21. data/examples/i18n/README.textile +18 -0
  22. data/examples/i18n/Rakefile +32 -0
  23. data/examples/i18n/ar/Rakefile +6 -0
  24. data/examples/i18n/ar/features/addition.feature +17 -0
  25. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +33 -0
  26. data/examples/i18n/ar/lib/calculator.rb +10 -0
  27. data/examples/i18n/da/Rakefile +6 -0
  28. data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +24 -0
  29. data/examples/i18n/da/features/summering.feature +17 -0
  30. data/examples/i18n/da/lib/kalkulator.rb +11 -0
  31. data/examples/i18n/de/Rakefile +6 -0
  32. data/examples/i18n/de/features/addition.feature +16 -0
  33. data/examples/i18n/de/features/division.feature +9 -0
  34. data/examples/i18n/de/features/step_definitons/calculator_steps.rb +24 -0
  35. data/examples/i18n/de/lib/calculator.rb +14 -0
  36. data/examples/i18n/en/Rakefile +6 -0
  37. data/examples/i18n/en/features/addition.feature +16 -0
  38. data/examples/i18n/en/features/division.feature +9 -0
  39. data/examples/i18n/en/features/step_definitons/calculator_steps.rb +24 -0
  40. data/examples/i18n/en/lib/calculator.rb +14 -0
  41. data/examples/i18n/es/Rakefile +6 -0
  42. data/examples/i18n/es/features/adicion.feature +17 -0
  43. data/examples/i18n/es/features/step_definitons/calculador_steps.rb +24 -0
  44. data/examples/i18n/es/lib/calculador.rb +11 -0
  45. data/examples/i18n/et/Rakefile +6 -0
  46. data/examples/i18n/et/features/liitmine.feature +16 -0
  47. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +24 -0
  48. data/examples/i18n/et/lib/kalkulaator.rb +10 -0
  49. data/examples/i18n/fi/Rakefile +6 -0
  50. data/examples/i18n/fi/features/jakolasku.feature +9 -0
  51. data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +24 -0
  52. data/examples/i18n/fi/features/yhteenlasku.feature +16 -0
  53. data/examples/i18n/fi/lib/laskin.rb +14 -0
  54. data/examples/i18n/fr/Rakefile +6 -0
  55. data/examples/i18n/fr/features/addition.feature +15 -0
  56. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +27 -0
  57. data/examples/i18n/fr/lib/calculatrice.rb +10 -0
  58. data/examples/i18n/id/Rakefile +6 -0
  59. data/examples/i18n/id/features/addition.feature +16 -0
  60. data/examples/i18n/id/features/division.feature +9 -0
  61. data/examples/i18n/id/features/step_definitons/calculator_steps.rb +24 -0
  62. data/examples/i18n/id/lib/calculator.rb +14 -0
  63. data/examples/i18n/it/Rakefile +6 -0
  64. data/examples/i18n/it/features/somma.feature +10 -0
  65. data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +24 -0
  66. data/examples/i18n/it/lib/calcolatrice.rb +11 -0
  67. data/examples/i18n/ja/README.txt +5 -0
  68. data/examples/i18n/ja/Rakefile +6 -0
  69. data/examples/i18n/ja/features/addition.feature +16 -0
  70. data/examples/i18n/ja/features/division.feature +9 -0
  71. data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +25 -0
  72. data/examples/i18n/ja/lib/calculator.rb +14 -0
  73. data/examples/i18n/ko/Rakefile +6 -0
  74. data/examples/i18n/ko/features/addition.feature +16 -0
  75. data/examples/i18n/ko/features/division.feature +10 -0
  76. data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +24 -0
  77. data/examples/i18n/ko/lib/calculator.rb +14 -0
  78. data/examples/i18n/lt/Rakefile +6 -0
  79. data/examples/i18n/lt/features/addition.feature +16 -0
  80. data/examples/i18n/lt/features/division.feature +9 -0
  81. data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +24 -0
  82. data/examples/i18n/lt/lib/calculator.rb +14 -0
  83. data/examples/i18n/no/Rakefile +6 -0
  84. data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +24 -0
  85. data/examples/i18n/no/features/summering.feature +17 -0
  86. data/examples/i18n/no/lib/kalkulator.rb +11 -0
  87. data/examples/i18n/pt/Rakefile +6 -0
  88. data/examples/i18n/pt/features/adicao.feature +10 -0
  89. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +24 -0
  90. data/examples/i18n/pt/lib/calculadora.rb +10 -0
  91. data/examples/i18n/ro/Rakefile +6 -0
  92. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +24 -0
  93. data/examples/i18n/ro/features/suma.feature +10 -0
  94. data/examples/i18n/ro/lib/calculator.rb +11 -0
  95. data/examples/i18n/se/Rakefile +6 -0
  96. data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +24 -0
  97. data/examples/i18n/se/features/summering.feature +17 -0
  98. data/examples/i18n/se/lib/kalkulator.rb +11 -0
  99. data/examples/i18n/zh-CN/Rakefile +6 -0
  100. data/examples/i18n/zh-CN/features/addition.feature +17 -0
  101. data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +26 -0
  102. data/examples/i18n/zh-CN/lib/calculator.rb +10 -0
  103. data/examples/java/README.textile +22 -0
  104. data/examples/java/Rakefile +12 -0
  105. data/examples/java/features/hello.feature +11 -0
  106. data/examples/java/features/step_definitons/hello_steps.rb +25 -0
  107. data/examples/java/features/step_definitons/tree_steps.rb +14 -0
  108. data/examples/java/features/tree.feature +9 -0
  109. data/examples/selenium/Rakefile +6 -0
  110. data/examples/selenium/features/search.feature +9 -0
  111. data/examples/selenium/features/step_definitons/stories_steps.rb +40 -0
  112. data/examples/self_test/README.textile +3 -0
  113. data/examples/self_test/features/outline_sample.feature +9 -0
  114. data/examples/self_test/features/sample.feature +14 -0
  115. data/examples/self_test/features/step_definitions/sample_steps.rb +13 -0
  116. data/examples/test_unit/Rakefile +6 -0
  117. data/examples/test_unit/features/step_definitions/test_unit_steps.rb +26 -0
  118. data/examples/test_unit/features/test_unit.feature +9 -0
  119. data/examples/tickets/Rakefile +11 -0
  120. data/examples/tickets/cucumber.yml +2 -0
  121. data/examples/tickets/features/lib/eatting_machine.rb +18 -0
  122. data/examples/tickets/features/lib/pantry.rb +20 -0
  123. data/examples/tickets/features/scenario_outline.feature +90 -0
  124. data/examples/tickets/features/step_definitons/scenario_outline_steps.rb +42 -0
  125. data/examples/tickets/features/step_definitons/tickets_steps.rb +36 -0
  126. data/examples/tickets/features/tickets.feature +24 -0
  127. data/examples/watir/README.textile +16 -0
  128. data/examples/watir/Rakefile +6 -0
  129. data/examples/watir/features/search.feature +9 -0
  130. data/examples/watir/features/step_definitons/search_steps.rb +24 -0
  131. data/examples/watir/features/support/env.rb +32 -0
  132. data/features/cucumber_cli.feature +223 -0
  133. data/features/cucumber_cli_outlines.feature +73 -0
  134. data/features/step_definitions/cucumber_steps.rb +27 -0
  135. data/features/step_definitions/extra_steps.rb +2 -0
  136. data/features/support/env.rb +7 -0
  137. data/gem_tasks/deployment.rake +11 -0
  138. data/gem_tasks/environment.rake +7 -0
  139. data/gem_tasks/features.rake +9 -0
  140. data/gem_tasks/fix_cr_lf.rake +10 -0
  141. data/gem_tasks/flog.rake +4 -0
  142. data/gem_tasks/gemspec.rake +10 -0
  143. data/gem_tasks/rspec.rake +38 -0
  144. data/gem_tasks/treetop.rake +41 -0
  145. data/gem_tasks/yard.rake +8 -0
  146. data/lib/autotest/cucumber.rb +6 -0
  147. data/lib/autotest/cucumber_mixin.rb +130 -0
  148. data/lib/autotest/cucumber_rails.rb +6 -0
  149. data/lib/autotest/cucumber_rails_rspec.rb +6 -0
  150. data/lib/autotest/cucumber_rspec.rb +6 -0
  151. data/lib/autotest/discover.rb +9 -0
  152. data/lib/cucumber/broadcaster.rb +20 -0
  153. data/lib/cucumber/cli.rb +355 -0
  154. data/lib/cucumber/core_ext/exception.rb +20 -0
  155. data/lib/cucumber/core_ext/proc.rb +69 -0
  156. data/lib/cucumber/core_ext/string.rb +29 -0
  157. data/lib/cucumber/executor.rb +205 -0
  158. data/lib/cucumber/formatters/ansicolor.rb +105 -0
  159. data/lib/cucumber/formatters/autotest_formatter.rb +23 -0
  160. data/lib/cucumber/formatters/cucumber.css +132 -0
  161. data/lib/cucumber/formatters/cucumber.js +11 -0
  162. data/lib/cucumber/formatters/html_formatter.rb +152 -0
  163. data/lib/cucumber/formatters/jquery.js +32 -0
  164. data/lib/cucumber/formatters/pretty_formatter.rb +285 -0
  165. data/lib/cucumber/formatters/profile_formatter.rb +92 -0
  166. data/lib/cucumber/formatters/progress_formatter.rb +61 -0
  167. data/lib/cucumber/formatters/unicode.rb +35 -0
  168. data/lib/cucumber/formatters.rb +1 -0
  169. data/lib/cucumber/languages.yml +286 -0
  170. data/lib/cucumber/model/table.rb +32 -0
  171. data/lib/cucumber/model.rb +1 -0
  172. data/lib/cucumber/platform.rb +32 -0
  173. data/lib/cucumber/rails/rspec.rb +5 -0
  174. data/lib/cucumber/rails/world.rb +73 -0
  175. data/lib/cucumber/rake/task.rb +112 -0
  176. data/lib/cucumber/step_methods.rb +49 -0
  177. data/lib/cucumber/step_mother.rb +98 -0
  178. data/lib/cucumber/tree/feature.rb +105 -0
  179. data/lib/cucumber/tree/features.rb +21 -0
  180. data/lib/cucumber/tree/given_scenario.rb +13 -0
  181. data/lib/cucumber/tree/scenario.rb +240 -0
  182. data/lib/cucumber/tree/step.rb +173 -0
  183. data/lib/cucumber/tree/table.rb +26 -0
  184. data/lib/cucumber/tree/top_down_visitor.rb +23 -0
  185. data/lib/cucumber/tree.rb +16 -0
  186. data/lib/cucumber/treetop_parser/feature.treetop.erb +254 -0
  187. data/lib/cucumber/treetop_parser/feature_ar.rb +1951 -0
  188. data/lib/cucumber/treetop_parser/feature_cy.rb +1951 -0
  189. data/lib/cucumber/treetop_parser/feature_da.rb +1951 -0
  190. data/lib/cucumber/treetop_parser/feature_de.rb +1951 -0
  191. data/lib/cucumber/treetop_parser/feature_en-lol.rb +1951 -0
  192. data/lib/cucumber/treetop_parser/feature_en-tx.rb +1951 -0
  193. data/lib/cucumber/treetop_parser/feature_en.rb +1951 -0
  194. data/lib/cucumber/treetop_parser/feature_es.rb +1951 -0
  195. data/lib/cucumber/treetop_parser/feature_et.rb +1951 -0
  196. data/lib/cucumber/treetop_parser/feature_fi.rb +1951 -0
  197. data/lib/cucumber/treetop_parser/feature_fr.rb +1951 -0
  198. data/lib/cucumber/treetop_parser/feature_id.rb +1951 -0
  199. data/lib/cucumber/treetop_parser/feature_it.rb +1951 -0
  200. data/lib/cucumber/treetop_parser/feature_ja.rb +1951 -0
  201. data/lib/cucumber/treetop_parser/feature_ko.rb +1951 -0
  202. data/lib/cucumber/treetop_parser/feature_lt.rb +1951 -0
  203. data/lib/cucumber/treetop_parser/feature_nl.rb +1951 -0
  204. data/lib/cucumber/treetop_parser/feature_no.rb +1951 -0
  205. data/lib/cucumber/treetop_parser/feature_parser.rb +36 -0
  206. data/lib/cucumber/treetop_parser/feature_pl.rb +1951 -0
  207. data/lib/cucumber/treetop_parser/feature_pt.rb +1951 -0
  208. data/lib/cucumber/treetop_parser/feature_ro.rb +1951 -0
  209. data/lib/cucumber/treetop_parser/feature_ro2.rb +1951 -0
  210. data/lib/cucumber/treetop_parser/feature_ru.rb +1951 -0
  211. data/lib/cucumber/treetop_parser/feature_se.rb +1951 -0
  212. data/lib/cucumber/treetop_parser/feature_zh-CN.rb +1951 -0
  213. data/lib/cucumber/version.rb +10 -0
  214. data/lib/cucumber/world/pending.rb +22 -0
  215. data/lib/cucumber/world.rb +1 -0
  216. data/lib/cucumber.rb +19 -0
  217. data/rails_generators/cucumber/USAGE +11 -0
  218. data/rails_generators/cucumber/cucumber_generator.rb +31 -0
  219. data/rails_generators/cucumber/templates/cucumber +7 -0
  220. data/rails_generators/cucumber/templates/cucumber.rake +7 -0
  221. data/rails_generators/cucumber/templates/env.rb +16 -0
  222. data/rails_generators/cucumber/templates/paths.rb +12 -0
  223. data/rails_generators/cucumber/templates/webrat_steps.rb +99 -0
  224. data/rails_generators/feature/USAGE +12 -0
  225. data/rails_generators/feature/feature_generator.rb +36 -0
  226. data/rails_generators/feature/templates/feature.erb +31 -0
  227. data/rails_generators/feature/templates/steps.erb +24 -0
  228. data/setup.rb +1585 -0
  229. data/spec/cucumber/broadcaster_spec.rb +27 -0
  230. data/spec/cucumber/cli_spec.rb +521 -0
  231. data/spec/cucumber/core_ext/proc_spec.rb +45 -0
  232. data/spec/cucumber/core_ext/string_spec.rb +34 -0
  233. data/spec/cucumber/executor_spec.rb +382 -0
  234. data/spec/cucumber/formatters/ansicolor_spec.rb +35 -0
  235. data/spec/cucumber/formatters/autotest_formatter_spec.rb +26 -0
  236. data/spec/cucumber/formatters/features.html +269 -0
  237. data/spec/cucumber/formatters/html_formatter_spec.rb +110 -0
  238. data/spec/cucumber/formatters/pretty_formatter_spec.rb +410 -0
  239. data/spec/cucumber/formatters/profile_formatter_spec.rb +197 -0
  240. data/spec/cucumber/formatters/progress_formatter_spec.rb +81 -0
  241. data/spec/cucumber/model/table_spec.rb +32 -0
  242. data/spec/cucumber/rails/stubs/mini_rails.rb +18 -0
  243. data/spec/cucumber/rails/stubs/test_help.rb +1 -0
  244. data/spec/cucumber/rails/world_spec.rb +11 -0
  245. data/spec/cucumber/sell_cucumbers.feature +19 -0
  246. data/spec/cucumber/step_mother_spec.rb +74 -0
  247. data/spec/cucumber/tree/feature_spec.rb +122 -0
  248. data/spec/cucumber/tree/row_scenario_outline_spec.rb +73 -0
  249. data/spec/cucumber/tree/row_scenario_spec.rb +55 -0
  250. data/spec/cucumber/tree/row_step_outline_spec.rb +38 -0
  251. data/spec/cucumber/tree/scenario_outline_spec.rb +50 -0
  252. data/spec/cucumber/tree/scenario_spec.rb +134 -0
  253. data/spec/cucumber/tree/step_outline_spec.rb +17 -0
  254. data/spec/cucumber/tree/step_spec.rb +59 -0
  255. data/spec/cucumber/treetop_parser/empty_feature.feature +4 -0
  256. data/spec/cucumber/treetop_parser/empty_scenario.feature +9 -0
  257. data/spec/cucumber/treetop_parser/empty_scenario_outline.feature +3 -0
  258. data/spec/cucumber/treetop_parser/feature_parser_spec.rb +120 -0
  259. data/spec/cucumber/treetop_parser/fit_scenario.feature +8 -0
  260. data/spec/cucumber/treetop_parser/given_scenario.feature +9 -0
  261. data/spec/cucumber/treetop_parser/invalid_scenario_outlines.feature +7 -0
  262. data/spec/cucumber/treetop_parser/multiline_steps.feature +17 -0
  263. data/spec/cucumber/treetop_parser/multiple_tables.feature +27 -0
  264. data/spec/cucumber/treetop_parser/scenario_outline.feature +16 -0
  265. data/spec/cucumber/treetop_parser/spaces.feature +10 -0
  266. data/spec/cucumber/treetop_parser/test_dos.feature +25 -0
  267. data/spec/cucumber/treetop_parser/with_comments.feature +10 -0
  268. data/spec/cucumber/world/pending_spec.rb +46 -0
  269. data/spec/spec.opts +3 -0
  270. data/spec/spec_helper.rb +21 -0
  271. metadata +363 -0
@@ -0,0 +1,286 @@
1
+ # http://www.ietf.org/rfc/rfc4646.txt
2
+ # http://www.ietf.org/rfc/rfc4647.txt
3
+ # Others:
4
+ # http://en.wikipedia.org/wiki/IETF_language_tag
5
+ # http://www.iana.org/assignments/language-subtag-registry
6
+ # http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt (Use this I think)
7
+ "en":
8
+ feature: Feature
9
+ scenario: Scenario
10
+ scenario_outline: Scenario Outline
11
+ examples: Examples
12
+ more_examples: More Examples
13
+ given_scenario: GivenScenario
14
+ given: Given
15
+ when: When
16
+ then: Then
17
+ and: And
18
+ but: But
19
+ # Please help us keeping the languages below uptodate. The parsers for a language
20
+ # that is missing a keyword will expect the English word until the missing word(s)
21
+ # are added.
22
+ #
23
+ # Please keep the grammars in alphabetical order from here and down.
24
+
25
+ # Arabic
26
+ "ar":
27
+ feature: خاصية
28
+ scenario: سيناريو
29
+ more_examples: امثلة اكثر
30
+ given_scenario: بفرض سيناريو معين
31
+ given: بفرض
32
+ when: متى
33
+ then: اذاً
34
+ and: و
35
+ but: لكن
36
+ # Welsh
37
+ "cy":
38
+ feature: Arwedd
39
+ scenario: Scenario
40
+ more_examples: Hychwaneg enghreifftiau
41
+ given_scenario: Anrhegedig scenario
42
+ given: anrhegedig a
43
+ when: Pryd
44
+ then: Yna
45
+ and: A
46
+ but: Ond
47
+ # Danish
48
+ "da":
49
+ feature: Egenskab
50
+ scenario: Scenarie
51
+ given_scenario: GivetScenarie
52
+ given: Givet
53
+ when: Når
54
+ then: Så
55
+ and: Og
56
+ but: Men
57
+ # German
58
+ "de":
59
+ feature: Funktionalität
60
+ scenario: Szenario
61
+ scenario_outline: Szenariogrundriss
62
+ examples: Beispiele
63
+ more_examples: Mehr Beispiele
64
+ given_scenario: Gegebenes Szenario
65
+ given: Gegeben sei
66
+ when: Wenn
67
+ then: Dann
68
+ and: Und
69
+ but: Aber
70
+ # LOLCAT
71
+ "en-lol":
72
+ feature: OH HAI
73
+ scenario: MISHUN
74
+ more_examples: MOAR EXAMPLZ
75
+ given_scenario: SRSLY
76
+ given: GIVN
77
+ when: WEN
78
+ then: DEN
79
+ and: AN
80
+ but: BUT
81
+ # Texan
82
+ "en-tx":
83
+ feature: Feature
84
+ scenario: Scenario
85
+ more_examples: More Examples
86
+ given_scenario: GivenScenario
87
+ given: Given y'all
88
+ when: When y'all
89
+ then: Then y'all
90
+ and: And y'all
91
+ but: But y'all
92
+ # Spanish
93
+ "es":
94
+ feature: Característica
95
+ scenario: Escenario
96
+ more_examples: Más ejemplos
97
+ given_scenario: DadoElEscenario
98
+ given: Dado
99
+ when: Cuando
100
+ then: Entonces
101
+ and: Y
102
+ but: Pero
103
+ # Estonian
104
+ "et":
105
+ feature: Omadus
106
+ scenario: Stsenaarium
107
+ given_scenario: EeldadesStsenaariumit
108
+ given: Eeldades
109
+ when: Kui
110
+ then: Siis
111
+ and: Ja
112
+ but: Kuid
113
+ # Finnish
114
+ "fi":
115
+ feature: Ominaisuus
116
+ scenario: Tapaus
117
+ scenario_outline: Tapausaihio
118
+ examples: Tapaukset
119
+ more_examples: Lisätapaukset
120
+ given_scenario: Oletetaan tapaus
121
+ given: Oletetaan
122
+ when: Kun
123
+ then: Niin
124
+ and: Ja
125
+ but: Mutta
126
+ # French
127
+ "fr":
128
+ feature: Fonctionnalité
129
+ scenario: Scénario
130
+ more_examples: Plus d'exemples
131
+ given_scenario: Soit le Scénario
132
+ given: Etant donné
133
+ when: Lorsque
134
+ then: Alors
135
+ and: Et
136
+ but: Mais
137
+ # Malay
138
+ "id":
139
+ feature: Fitur
140
+ scenario: Skenario
141
+ more_examples: Contoh Tambahan
142
+ given_scenario: DenganSkenario
143
+ given: Dengan
144
+ when: Ketika
145
+ then: Maka
146
+ and: Dan
147
+ but: Tapi
148
+ # Italian
149
+ "it":
150
+ feature: Funzionalità
151
+ scenario: Scenario
152
+ more_examples: Più esempi
153
+ given_scenario: DatoLoScenario
154
+ given: Dato
155
+ when: Quando
156
+ then: Allora
157
+ and: E
158
+ but: Ma
159
+ # Japanese
160
+ "ja":
161
+ feature: フィーチャ
162
+ scenario: シナリオ
163
+ more_examples: 他のサンプル
164
+ given_scenario: 前提シナリオ
165
+ given: 前提
166
+ when: もし
167
+ then: ならば
168
+ and: かつ
169
+ but: しかし
170
+ # Lithuanian
171
+ "lt":
172
+ feature: Sąvybė
173
+ scenario: Scenarijus
174
+ more_examples: Daugiau pavyzdžių
175
+ given_scenario: DuotasScenarijus
176
+ given: Duota
177
+ when: Kai
178
+ then: Tada
179
+ and: Ir
180
+ but: Bet
181
+ # Dutch
182
+ "nl":
183
+ feature: Functionaliteit
184
+ scenario: Scenario
185
+ more_examples: Meer voorbeelden
186
+ given_scenario: GegevenScenario
187
+ given: Gegeven
188
+ when: Als
189
+ then: Dan
190
+ and: En
191
+ but: Maar
192
+ # Norwegian
193
+ "no":
194
+ feature: Egenskap
195
+ scenario: Scenario
196
+ more_examples: Flere eksempler
197
+ given_scenario: GittScenario
198
+ given: Gitt
199
+ when: Når
200
+ then: Så
201
+ and: Og
202
+ but: Men
203
+ # Polish
204
+ "pl":
205
+ feature: Właściwość
206
+ scenario: Scenariusz
207
+ more_examples: WięcejPrzykładów
208
+ given_scenario: DanyScenariusz
209
+ given: Dane
210
+ when: Jeżeli
211
+ then: Wtedy
212
+ and: Oraz
213
+ but: Ale
214
+ # Portuguese
215
+ "pt":
216
+ feature: Característica
217
+ scenario: Cenário
218
+ given_scenario: DadoOCenário
219
+ given: Dado
220
+ when: Quando
221
+ then: Então
222
+ and: E
223
+ but: Mas
224
+ # Romanian (without diacritics - the commonly used)
225
+ "ro":
226
+ feature: Functionalitate
227
+ scenario: Scenariu
228
+ more_examples: Mai multe exemple
229
+ given_scenario: ScenariuDat
230
+ given: Daca
231
+ when: Cand
232
+ then: Atunci
233
+ and: Si
234
+ but: Dar
235
+ # Romanian (with diacritics - not commonly used)
236
+ "ro2":
237
+ feature: Funcționalitate
238
+ scenario: Scenariu
239
+ more_examples: Mai multe exemple
240
+ given_scenario: ScenariuDat
241
+ given: Dacă
242
+ when: Când
243
+ then: Atunci
244
+ and: Și
245
+ but: Dar
246
+ # Russian
247
+ "ru":
248
+ feature: Функционал
249
+ scenario: Сценарий
250
+ given_scenario: ДанныйСценарий
251
+ given: Сначала
252
+ when: Если
253
+ then: То
254
+ and: И
255
+ but: Но
256
+ # Swedish
257
+ "se":
258
+ feature: Egenskap
259
+ scenario: Scenario
260
+ given_scenario: GivetScenario
261
+ given: Givet
262
+ when: När
263
+ then: Så
264
+ and: Och
265
+ but: Men
266
+ # Chinese simplified
267
+ "zh-CN":
268
+ feature: 功能
269
+ scenario: 场景
270
+ given_scenario: 引用场景
271
+ given: 假如
272
+ when: 当
273
+ then: 那么
274
+ and: 而且
275
+ but: 但是
276
+ # Korean
277
+ "ko":
278
+ feature: 기능
279
+ scenario: 예
280
+ more_examples: 다른 예
281
+ given_scenario: 주어진 예
282
+ given: 조건
283
+ when: 만일
284
+ then: 그러면
285
+ and: 그리고
286
+ but: 하지만
@@ -0,0 +1,32 @@
1
+ module Cucumber
2
+ module Model
3
+ class Table
4
+ attr_accessor :raw
5
+
6
+ # Creates a new table. The +raw+ argument should be an array
7
+ # of arrays
8
+ def initialize(raw)
9
+ @raw = raw
10
+ end
11
+
12
+ # Turn the table into an array of Hash where each Hash
13
+ # has keys corresponding to the table header (first line)
14
+ # and the values are the individual row cells.
15
+ def hashes
16
+ header = @raw[0]
17
+ rows.map do |row|
18
+ h = {}
19
+ row.each_with_index do |v,n|
20
+ key = header[n]
21
+ h[key] = v
22
+ end
23
+ h
24
+ end
25
+ end
26
+
27
+ def rows
28
+ @raw[1..-1]
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1 @@
1
+ %w{table}.each{|f| require "cucumber/model/#{f}"}
@@ -0,0 +1,32 @@
1
+ # Detect the platform we're running on so we can tweak behaviour
2
+ # in various places.
3
+ require 'rbconfig'
4
+
5
+ module Cucumber
6
+ LANGUAGE_FILE = File.expand_path(File.dirname(__FILE__) + '/languages.yml')
7
+ BINARY = File.expand_path(File.dirname(__FILE__) + '/../../bin/cucumber')
8
+ JRUBY = defined?(JRUBY_VERSION)
9
+ IRONRUBY = Config::CONFIG['sitedir'] =~ /IronRuby/
10
+ WINDOWS = Config::CONFIG['host_os'] =~ /mswin|mingw/
11
+ WINDOWS_MRI = WINDOWS && !JRUBY && !IRONRUBY
12
+ RAILS = defined?(Rails)
13
+ RUBY_BINARY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
14
+ RUBY_1_9 = RUBY_VERSION =~ /^1\.9/
15
+
16
+ class << self
17
+ attr_reader :language
18
+
19
+ def load_language(lang)
20
+ @language = config[lang]
21
+ end
22
+
23
+ def languages
24
+ config.keys.sort
25
+ end
26
+
27
+ def config
28
+ require 'yaml'
29
+ @config ||= YAML.load_file(LANGUAGE_FILE)
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec/expectations'
2
+ require 'spec/rails/matchers'
3
+
4
+ ActionController::Integration::Session.send(:include, Spec::Matchers)
5
+ ActionController::Integration::Session.send(:include, Spec::Rails::Matchers)
@@ -0,0 +1,73 @@
1
+ # Based on code from Brian Takita, Yurii Rashkovskii and Ben Mabey
2
+ # Adapted by Aslak Hellesøy
3
+
4
+ if defined?(ActiveRecord::Base)
5
+ require 'test_help'
6
+ else
7
+ require 'action_controller/test_process'
8
+ require 'action_controller/integration'
9
+ end
10
+ require 'test/unit/testresult'
11
+
12
+ # These allow exceptions to come through as opposed to being caught and having non-helpful responses returned.
13
+ ActionController::Base.class_eval do
14
+ def perform_action_with_rescue
15
+ perform_action_without_rescue
16
+ end
17
+ end
18
+ ActionController::Dispatcher.class_eval do
19
+ def self.failsafe_response(output, status, exception = nil)
20
+ raise exception
21
+ end
22
+ end
23
+
24
+ # So that Test::Unit doesn't launch at the end - makes it think it has already been run.
25
+ Test::Unit.run = true if Test::Unit.respond_to?(:run=)
26
+
27
+ $cucumber_toplevel = self
28
+
29
+ module Cucumber #:nodoc:
30
+ module Rails
31
+ # All scenarios will execute in the context of a new instance of World.
32
+ class World < ActionController::IntegrationTest
33
+ if defined?(ActiveRecord::Base)
34
+ self.use_transactional_fixtures = false
35
+ else
36
+ def self.fixture_table_names; []; end # Workaround for projects that don't use ActiveRecord
37
+ end
38
+
39
+ def initialize #:nodoc:
40
+ @_result = Test::Unit::TestResult.new
41
+ end
42
+ end
43
+
44
+ def self.use_transactional_fixtures
45
+ World.use_transactional_fixtures = true
46
+ if defined?(ActiveRecord::Base)
47
+ $cucumber_toplevel.Before do
48
+ if ActiveRecord::Base.connection.respond_to?(:increment_open_transactions)
49
+ ActiveRecord::Base.connection.increment_open_transactions
50
+ else
51
+ ActiveRecord::Base.__send__(:increment_open_transactions)
52
+ end
53
+ ActiveRecord::Base.connection.begin_db_transaction
54
+ ActionMailer::Base.deliveries = [] if defined?(ActionMailer::Base)
55
+ end
56
+
57
+ $cucumber_toplevel.After do
58
+ ActiveRecord::Base.connection.rollback_db_transaction
59
+ if ActiveRecord::Base.connection.respond_to?(:decrement_open_transactions)
60
+ ActiveRecord::Base.connection.decrement_open_transactions
61
+ else
62
+ ActiveRecord::Base.__send__(:decrement_open_transactions)
63
+ end
64
+ end
65
+ end
66
+ end
67
+
68
+ end
69
+ end
70
+
71
+ World do
72
+ Cucumber::Rails::World.new
73
+ end
@@ -0,0 +1,112 @@
1
+ require 'cucumber/platform'
2
+
3
+ module Cucumber
4
+ module Rake
5
+ # Defines a task for running features.
6
+ class Task
7
+ LIB = File.expand_path(File.dirname(__FILE__) + '/../..')
8
+
9
+ attr_accessor :libs
10
+ attr_accessor :binary
11
+ attr_accessor :step_list
12
+ attr_accessor :step_pattern
13
+ attr_accessor :feature_list
14
+ attr_accessor :feature_pattern
15
+ attr_accessor :cucumber_opts
16
+ attr_accessor :rcov
17
+ attr_accessor :rcov_opts
18
+ attr_accessor :language
19
+
20
+ # Define a task
21
+ def initialize(task_name = "features", desc = "Run Features with Cucumber")
22
+ @task_name, @desc = task_name, desc
23
+ @libs = []
24
+ @rcov_opts = %w{--rails --exclude osx\/objc,gems\/}
25
+
26
+ yield self if block_given?
27
+
28
+ if language
29
+ @feature_pattern = "features/#{language}/*.feature"
30
+ @step_pattern = "features/#{language}/step_definitions/*.rb"
31
+ else
32
+ @feature_pattern = "features/**/*.feature" if feature_pattern.nil? && feature_list.nil?
33
+ @step_pattern = "features/**/*.rb" if step_pattern.nil? && step_list.nil?
34
+ end
35
+
36
+ @binary = binary.nil? ? Cucumber::BINARY : File.expand_path(binary)
37
+ @libs.insert(0, LIB) if binary == Cucumber::BINARY
38
+
39
+ define_task
40
+ end
41
+
42
+ def define_task
43
+ desc @desc
44
+ task @task_name do
45
+ ruby(arguments_for_ruby_execution.join(" ")) # ruby(*args) is broken on Windows
46
+ end
47
+ end
48
+
49
+ def arguments_for_ruby_execution(task_args = nil)
50
+ lib_args = ['"%s"' % libs.join(File::PATH_SEPARATOR)]
51
+ cucumber_bin = ['"%s"' % binary]
52
+ cuc_opts = [(ENV['CUCUMBER_OPTS'] || cucumber_opts)]
53
+
54
+ step_files(task_args).each do |step_file|
55
+ cuc_opts << '--require'
56
+ cuc_opts << step_file
57
+ end
58
+
59
+ if rcov
60
+ args = (['-I'] + lib_args + ['-S', 'rcov'] + rcov_opts +
61
+ cucumber_bin + ['--'] + cuc_opts + feature_files(task_args)).flatten
62
+ else
63
+ args = (['-I'] + lib_args + cucumber_bin + cuc_opts + feature_files(task_args)).flatten
64
+ end
65
+
66
+ args
67
+ end
68
+
69
+ def feature_files(task_args = nil) # :nodoc:
70
+ if ENV['FEATURE']
71
+ FileList[ ENV['FEATURE'] ]
72
+ else
73
+ result = []
74
+ result += feature_list.to_a if feature_list
75
+ result += FileList[feature_pattern].to_a if feature_pattern
76
+ FileList[result]
77
+ end
78
+ end
79
+
80
+ def step_files(task_args = nil) # :nodoc:
81
+ if ENV['STEPS']
82
+ FileList[ ENV['STEPS'] ]
83
+ else
84
+ result = []
85
+ result += Array(step_list) if step_list
86
+ result += Array(FileList[step_pattern]) if step_pattern
87
+ FileList[result]
88
+ end
89
+ end
90
+ end
91
+
92
+ class FeatureTask < Task
93
+
94
+ def initialize(task_name = "feature", desc = "Run a specified feature with Cucumber. #{task_name}[feature_name]")
95
+ super(task_name, desc)
96
+ end
97
+
98
+ def define_task
99
+ desc @desc
100
+ task @task_name, :feature_name do |t, args|
101
+ ruby(arguments_for_ruby_execution(args).join(" ")) # ruby(*args) is broken on Windows
102
+ end
103
+ end
104
+
105
+ def feature_files(task_arguments) # :nodoc:
106
+ FileList[File.join("features", "**", "#{task_arguments[:feature_name]}.feature")]
107
+ end
108
+
109
+ end
110
+
111
+ end
112
+ end
@@ -0,0 +1,49 @@
1
+ require 'cucumber/step_mother'
2
+
3
+ module Cucumber
4
+ # Defines "global" methods that may be used in *_steps.rb files.
5
+ module StepMethods
6
+ # Each scenario will execute in the context of what the supplied block returns.
7
+ def World(&proc)
8
+ executor.register_world_proc(&proc)
9
+ end
10
+
11
+ def Before(&proc)
12
+ executor.register_before_scenario_proc(&proc)
13
+ end
14
+
15
+ def After(&proc)
16
+ executor.register_after_scenario_proc(&proc)
17
+ end
18
+
19
+ def AfterStep(&proc)
20
+ executor.register_after_step_proc(&proc)
21
+ end
22
+
23
+ def Given(key, &proc)
24
+ step_mother.register_step_proc(key, &proc)
25
+ end
26
+
27
+ def When(key, &proc)
28
+ step_mother.register_step_proc(key, &proc)
29
+ end
30
+
31
+ def Then(key, &proc)
32
+ step_mother.register_step_proc(key, &proc)
33
+ end
34
+
35
+ # Simple workaround for old skool steps
36
+ def steps_for(*_)
37
+ STDERR.puts "WARNING: In Cucumber the steps_for method is obsolete"
38
+ yield
39
+ end
40
+
41
+ def step_mother #:nodoc:
42
+ @step_mother ||= StepMother.new
43
+ end
44
+
45
+ def executor
46
+ @executor ||= Executor.new(step_mother)
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,98 @@
1
+ require 'cucumber/tree/top_down_visitor'
2
+
3
+ module Cucumber
4
+ class Pending < StandardError
5
+ end
6
+
7
+ class ForcedPending < Pending
8
+ end
9
+
10
+ class Duplicate < StandardError
11
+ end
12
+
13
+ class Multiple < StandardError
14
+ end
15
+
16
+ class MissingProc < StandardError
17
+ def message
18
+ "Step definitions must always have a proc"
19
+ end
20
+ end
21
+
22
+ class StepMother
23
+ PENDING = lambda do |*_|
24
+ raise Pending
25
+ end
26
+ require 'cucumber/core_ext/proc'
27
+ PENDING.extend(CoreExt::CallIn)
28
+ PENDING.name = "PENDING"
29
+
30
+ def initialize
31
+ @step_procs = Hash.new(PENDING)
32
+ end
33
+
34
+ def register_step_proc(key, &proc)
35
+ raise MissingProc if proc.nil?
36
+ regexp = case(key)
37
+ when String
38
+ # Replace the $foo and $bar style parameters
39
+ pattern = key.gsub(/\$\w+/, '(.*)')
40
+ Regexp.new("^#{pattern}$")
41
+ when Regexp
42
+ key
43
+ else
44
+ raise "Step patterns must be Regexp or String, but was: #{key.inspect}"
45
+ end
46
+ proc.extend(CoreExt::CallIn)
47
+ proc.name = key.inspect
48
+
49
+ if @step_procs.has_key?(regexp)
50
+ first_proc = @step_procs[regexp]
51
+ message = %{Duplicate step definitions:
52
+
53
+ #{first_proc.to_backtrace_line}
54
+ #{proc.to_backtrace_line}
55
+
56
+ }
57
+ raise Duplicate.new(message)
58
+ end
59
+
60
+ @step_procs[regexp] = proc
61
+ end
62
+
63
+ def regexp_args_proc(step_name)
64
+ candidates = @step_procs.map do |regexp, proc|
65
+ if step_name =~ regexp
66
+ [regexp, $~.captures, proc]
67
+ end
68
+ end.compact
69
+
70
+ case(candidates.length)
71
+ when 0
72
+ [nil, [], PENDING]
73
+ when 1
74
+ candidates[0]
75
+ else
76
+ message = %{Multiple step definitions match #{step_name.inspect}:
77
+
78
+ #{candidates.map{|regexp, args, proc| proc.to_backtrace_line}.join("\n")}
79
+
80
+ }
81
+ raise Multiple.new(message)
82
+ end
83
+ end
84
+
85
+ def proc_for(regexp)
86
+ @step_procs[regexp]
87
+ end
88
+
89
+ def has_step_definition?(step_name)
90
+ _, _, proc = regexp_args_proc(step_name)
91
+ proc != PENDING
92
+ end
93
+
94
+ # TODO - move execute here?
95
+ def execute(step)
96
+ end
97
+ end
98
+ end