cucumber 0.1.16 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (322) hide show
  1. data/History.txt +111 -5
  2. data/License.txt +1 -1
  3. data/Manifest.txt +141 -83
  4. data/Rakefile +1 -1
  5. data/bin/cucumber +2 -2
  6. data/config/hoe.rb +8 -2
  7. data/examples/cs/features/addition.feature +4 -5
  8. data/examples/cs/features/step_definitons/calculator_steps.rb +1 -5
  9. data/examples/i18n/README.textile +1 -1
  10. data/examples/i18n/Rakefile +5 -5
  11. data/examples/i18n/ar/features/addition.feature +10 -11
  12. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -10
  13. data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +1 -1
  14. data/examples/i18n/de/features/addition.feature +10 -11
  15. data/examples/i18n/de/features/division.feature +0 -1
  16. data/examples/i18n/de/features/step_definitons/calculator_steps.rb +2 -10
  17. data/examples/i18n/en-lol/Rakefile +6 -0
  18. data/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb +16 -0
  19. data/examples/i18n/en-lol/features/stuffing.feature +8 -0
  20. data/examples/i18n/en-lol/features/support/env.rb +8 -0
  21. data/examples/i18n/en-lol/lib/basket.rb +12 -0
  22. data/examples/i18n/en-lol/lib/belly.rb +11 -0
  23. data/examples/i18n/en/features/addition.feature +10 -11
  24. data/examples/i18n/en/features/division.feature +0 -1
  25. data/examples/i18n/en/features/step_definitons/calculator_steps.rb +2 -6
  26. data/examples/i18n/es/features/adicion.feature +11 -12
  27. data/examples/i18n/es/features/step_definitons/calculador_steps.rb +7 -10
  28. data/examples/i18n/es/lib/calculador.rb +4 -1
  29. data/examples/i18n/et/features/jagamine.feature +9 -0
  30. data/examples/i18n/et/features/liitmine.feature +10 -11
  31. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +4 -8
  32. data/examples/i18n/et/lib/kalkulaator.rb +5 -1
  33. data/examples/i18n/fi/Rakefile +6 -0
  34. data/examples/i18n/fi/features/jakolasku.feature +9 -0
  35. data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +24 -0
  36. data/examples/i18n/fi/features/yhteenlasku.feature +16 -0
  37. data/examples/i18n/fi/lib/laskin.rb +14 -0
  38. data/examples/i18n/fr/features/addition.feature +14 -12
  39. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +11 -13
  40. data/examples/i18n/fr/lib/calculatrice.rb +1 -1
  41. data/examples/i18n/id/features/addition.feature +10 -11
  42. data/examples/i18n/id/features/division.feature +0 -1
  43. data/examples/i18n/id/features/step_definitons/calculator_steps.rb +2 -11
  44. data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +1 -1
  45. data/examples/i18n/ja/features/addition.feature +10 -11
  46. data/examples/i18n/ja/features/division.feature +2 -3
  47. data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +4 -13
  48. data/examples/i18n/ko/features/addition.feature +7 -8
  49. data/examples/i18n/ko/features/division.feature +3 -4
  50. data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +1 -5
  51. data/examples/i18n/lt/features/addition.feature +11 -11
  52. data/examples/i18n/lt/features/division.feature +0 -1
  53. data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +2 -11
  54. data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +3 -10
  55. data/examples/i18n/no/features/summering.feature +1 -0
  56. data/examples/i18n/no/features/support/env.rb +6 -0
  57. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +1 -1
  58. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +1 -1
  59. data/examples/i18n/ru/Rakefile +6 -0
  60. data/examples/i18n/ru/features/addition.feature +10 -0
  61. data/examples/i18n/ru/features/consecutive_calculations.feature +16 -0
  62. data/examples/i18n/ru/features/division.feature +15 -0
  63. data/examples/i18n/ru/features/step_definitons/calculator_steps.rb +19 -0
  64. data/examples/i18n/ru/features/support/env.rb +6 -0
  65. data/examples/i18n/ru/features/support/world.rb +7 -0
  66. data/examples/i18n/ru/lib/calculator.rb +24 -0
  67. data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +1 -1
  68. data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +2 -2
  69. data/examples/i18n/zh-TW/Rakefile +6 -0
  70. data/examples/i18n/zh-TW/features/addition.feature +16 -0
  71. data/examples/i18n/zh-TW/features/division.feature +10 -0
  72. data/examples/i18n/zh-TW/features/step_definitons/calculator_steps.rb +24 -0
  73. data/examples/i18n/zh-TW/lib/calculator.rb +14 -0
  74. data/examples/java/src/cucumber/demo/Hello.java +16 -0
  75. data/examples/jbehave/README.textile +20 -0
  76. data/examples/jbehave/features/support/env.rb +7 -0
  77. data/examples/jbehave/features/trading.feature +28 -0
  78. data/examples/jbehave/pom.xml +53 -0
  79. data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/converters/TraderConverter.java +32 -0
  80. data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/model/Stock.java +42 -0
  81. data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/model/Trader.java +29 -0
  82. data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/persistence/TraderPersister.java +22 -0
  83. data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/scenarios/TraderSteps.java +70 -0
  84. data/examples/selenium/features/step_definitons/search_steps.rb +13 -0
  85. data/examples/selenium/features/support/env.rb +19 -0
  86. data/examples/{calculator_ruby_features → selenium_webrat}/Rakefile +0 -0
  87. data/examples/selenium_webrat/features/search.feature +9 -0
  88. data/examples/selenium_webrat/features/step_definitons/search_steps.rb +13 -0
  89. data/examples/selenium_webrat/features/support/env.rb +41 -0
  90. data/examples/self_test/README.textile +4 -1
  91. data/examples/self_test/Rakefile +6 -0
  92. data/examples/self_test/features/background/failing_background.feature +11 -0
  93. data/examples/self_test/features/background/failing_background_after_success.feature +11 -0
  94. data/examples/self_test/features/background/multiline_args_background.feature +32 -0
  95. data/examples/self_test/features/background/passing_background.feature +10 -0
  96. data/examples/self_test/features/background/pending_background.feature +10 -0
  97. data/examples/self_test/features/background/scenario_outline_failing_background.feature +16 -0
  98. data/examples/self_test/features/background/scenario_outline_passing_background.feature +16 -0
  99. data/examples/self_test/features/call_undefined_step_from_step_def.feature +7 -0
  100. data/examples/self_test/features/failing_expectation.feature +4 -0
  101. data/examples/self_test/features/lots_of_undefined.feature +8 -0
  102. data/examples/self_test/features/outline_sample.feature +11 -5
  103. data/examples/self_test/features/sample.feature +8 -3
  104. data/examples/self_test/features/step_definitions/sample_steps.rb +55 -4
  105. data/examples/self_test/features/support/env.rb +1 -0
  106. data/examples/self_test/features/support/tag_count_formatter.rb +25 -0
  107. data/examples/sinatra/Rakefile +6 -0
  108. data/examples/sinatra/app.rb +14 -0
  109. data/examples/sinatra/features/add.feature +11 -0
  110. data/examples/sinatra/features/step_definitions/add_steps.rb +15 -0
  111. data/examples/sinatra/features/support/env.rb +20 -0
  112. data/examples/sinatra/views/add.erb +5 -0
  113. data/examples/sinatra/views/layout.erb +8 -0
  114. data/examples/tickets/Rakefile +13 -8
  115. data/examples/tickets/cucumber.yml +2 -1
  116. data/examples/tickets/features/172.feature +28 -0
  117. data/examples/tickets/features/177/1.feature +29 -0
  118. data/examples/tickets/features/177/2.feature +21 -0
  119. data/examples/tickets/features/177/3.feature +18 -0
  120. data/examples/tickets/features/180.feature +7 -0
  121. data/examples/tickets/features/236.feature +13 -0
  122. data/examples/tickets/features/241.feature +13 -0
  123. data/examples/tickets/features/scenario_outline.feature +6 -1
  124. data/examples/tickets/features/step_definitons/tickets_steps.rb +41 -4
  125. data/examples/tickets/features/tickets.feature +5 -1
  126. data/features/background.feature +221 -0
  127. data/features/cucumber_cli.feature +263 -97
  128. data/features/cucumber_cli_diff_disabled.feature +45 -0
  129. data/features/cucumber_cli_outlines.feature +50 -42
  130. data/features/custom_formatter.feature +11 -0
  131. data/features/report_called_undefined_steps.feature +34 -0
  132. data/features/step_definitions/cucumber_steps.rb +6 -3
  133. data/features/step_definitions/extra_steps.rb +1 -1
  134. data/features/support/env.rb +3 -2
  135. data/gem_tasks/features.rake +1 -1
  136. data/gem_tasks/flog.rake +1 -1
  137. data/gem_tasks/gemspec.rake +2 -2
  138. data/gem_tasks/jar.rake +67 -0
  139. data/gem_tasks/rspec.rake +2 -0
  140. data/lib/autotest/cucumber_mixin.rb +18 -23
  141. data/lib/cucumber.rb +55 -11
  142. data/lib/cucumber/ast.rb +29 -0
  143. data/lib/cucumber/ast/background.rb +50 -0
  144. data/lib/cucumber/ast/comment.rb +26 -0
  145. data/lib/cucumber/ast/examples.rb +38 -0
  146. data/lib/cucumber/ast/feature.rb +62 -0
  147. data/lib/cucumber/ast/feature_element.rb +46 -0
  148. data/lib/cucumber/ast/features.rb +20 -0
  149. data/lib/cucumber/ast/outline_table.rb +81 -0
  150. data/lib/cucumber/ast/py_string.rb +58 -0
  151. data/lib/cucumber/ast/scenario.rb +64 -0
  152. data/lib/cucumber/ast/scenario_outline.rb +90 -0
  153. data/lib/cucumber/ast/step.rb +122 -0
  154. data/lib/cucumber/ast/step_collection.rb +66 -0
  155. data/lib/cucumber/ast/step_invocation.rb +110 -0
  156. data/lib/cucumber/ast/table.rb +318 -0
  157. data/lib/cucumber/ast/tags.rb +33 -0
  158. data/lib/cucumber/ast/visitor.rb +125 -0
  159. data/lib/cucumber/broadcaster.rb +2 -9
  160. data/lib/cucumber/cli/configuration.rb +364 -0
  161. data/lib/cucumber/cli/language_help_formatter.rb +59 -0
  162. data/lib/cucumber/cli/main.rb +109 -0
  163. data/lib/cucumber/core_ext/exception.rb +41 -8
  164. data/lib/cucumber/core_ext/instance_exec.rb +54 -0
  165. data/lib/cucumber/core_ext/proc.rb +29 -65
  166. data/lib/cucumber/core_ext/string.rb +19 -0
  167. data/lib/cucumber/formatter.rb +1 -0
  168. data/lib/cucumber/{formatters → formatter}/ansicolor.rb +13 -16
  169. data/lib/cucumber/formatter/color_io.rb +23 -0
  170. data/lib/cucumber/formatter/console.rb +109 -0
  171. data/lib/cucumber/formatter/cucumber.css +55 -0
  172. data/lib/cucumber/formatter/cucumber.sass +49 -0
  173. data/lib/cucumber/formatter/html.rb +133 -0
  174. data/lib/cucumber/formatter/pretty.rb +179 -0
  175. data/lib/cucumber/formatter/profile.rb +77 -0
  176. data/lib/cucumber/formatter/progress.rb +60 -0
  177. data/lib/cucumber/formatter/rerun.rb +35 -0
  178. data/lib/cucumber/formatter/unicode.rb +35 -0
  179. data/lib/cucumber/formatters/unicode.rb +2 -35
  180. data/lib/cucumber/jbehave.rb +97 -0
  181. data/lib/cucumber/languages.yml +196 -80
  182. data/lib/cucumber/parser.rb +43 -0
  183. data/lib/cucumber/parser/basic.rb +0 -0
  184. data/lib/cucumber/parser/feature.rb +1487 -0
  185. data/lib/cucumber/parser/feature.tt +193 -0
  186. data/lib/cucumber/parser/i18n.tt +31 -0
  187. data/lib/cucumber/parser/table.rb +402 -0
  188. data/lib/cucumber/parser/table.tt +59 -0
  189. data/lib/cucumber/parser/treetop_ext.rb +75 -0
  190. data/lib/cucumber/platform.rb +2 -17
  191. data/lib/cucumber/rails/rspec.rb +5 -9
  192. data/lib/cucumber/rails/world.rb +2 -2
  193. data/lib/cucumber/rake/task.rb +39 -7
  194. data/lib/cucumber/step_definition.rb +103 -0
  195. data/lib/cucumber/step_match.rb +49 -0
  196. data/lib/cucumber/step_mother.rb +183 -67
  197. data/lib/cucumber/version.rb +2 -2
  198. data/lib/cucumber/world.rb +53 -1
  199. data/rails_generators/cucumber/cucumber_generator.rb +22 -3
  200. data/rails_generators/cucumber/templates/cucumber +2 -1
  201. data/rails_generators/cucumber/templates/cucumber.rake +13 -5
  202. data/rails_generators/cucumber/templates/env.rb +4 -3
  203. data/rails_generators/cucumber/templates/paths.rb +18 -11
  204. data/rails_generators/cucumber/templates/webrat_steps.rb +41 -25
  205. data/rails_generators/feature/feature_generator.rb +4 -0
  206. data/rails_generators/feature/templates/steps.erb +0 -4
  207. data/spec/cucumber/ast/background_spec.rb +49 -0
  208. data/spec/cucumber/ast/feature_factory.rb +63 -0
  209. data/spec/cucumber/ast/feature_spec.rb +37 -0
  210. data/spec/cucumber/ast/py_string_spec.rb +47 -0
  211. data/spec/cucumber/ast/scenario_outline_spec.rb +67 -0
  212. data/spec/cucumber/ast/scenario_spec.rb +65 -0
  213. data/spec/cucumber/ast/step_collection_spec.rb +8 -0
  214. data/spec/cucumber/ast/step_spec.rb +66 -0
  215. data/spec/cucumber/ast/table_spec.rb +149 -0
  216. data/spec/cucumber/ast/tags_spec.rb +19 -0
  217. data/spec/cucumber/broadcaster_spec.rb +6 -18
  218. data/spec/cucumber/cli/configuration_spec.rb +275 -0
  219. data/spec/cucumber/cli/main_spec.rb +203 -0
  220. data/spec/cucumber/core_ext/proc_spec.rb +27 -35
  221. data/spec/cucumber/core_ext/string_spec.rb +8 -0
  222. data/spec/cucumber/{formatters → formatter}/ansicolor_spec.rb +2 -2
  223. data/spec/cucumber/formatter/color_io_spec.rb +26 -0
  224. data/spec/cucumber/formatter/html/cucumber.css +37 -0
  225. data/spec/cucumber/formatter/html/cucumber.js +13 -0
  226. data/spec/cucumber/formatter/html/index.html +45 -0
  227. data/spec/cucumber/formatter/html/jquery-1.3.min.js +19 -0
  228. data/spec/cucumber/formatter/html/jquery.uitableedit.js +100 -0
  229. data/spec/cucumber/formatters/profile_formatter_spec.rb +17 -16
  230. data/spec/cucumber/parser/feature_parser_spec.rb +282 -0
  231. data/spec/cucumber/parser/table_parser_spec.rb +48 -0
  232. data/spec/cucumber/step_definition_spec.rb +81 -0
  233. data/spec/cucumber/step_mother_spec.rb +50 -51
  234. data/spec/cucumber/treetop_parser/empty_feature.feature +1 -1
  235. data/spec/cucumber/treetop_parser/multiple_tables.feature +6 -8
  236. data/spec/cucumber/treetop_parser/scenario_outline.feature +1 -1
  237. data/spec/cucumber/treetop_parser/spaces.feature +3 -1
  238. data/spec/cucumber/treetop_parser/with_comments.feature +1 -1
  239. data/spec/cucumber/treetop_parser/with_tags.feature +18 -0
  240. data/spec/cucumber/world/pending_spec.rb +13 -12
  241. data/spec/spec_helper.rb +1 -1
  242. metadata +165 -88
  243. data/examples/calculator_ruby_features/features/addition.rb +0 -39
  244. data/examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb +0 -43
  245. data/examples/i18n/ja/README.txt +0 -5
  246. data/examples/selenium/features/step_definitons/stories_steps.rb +0 -40
  247. data/gem_tasks/treetop.rake +0 -41
  248. data/lib/cucumber/cli.rb +0 -356
  249. data/lib/cucumber/executor.rb +0 -205
  250. data/lib/cucumber/formatters.rb +0 -1
  251. data/lib/cucumber/formatters/autotest_formatter.rb +0 -23
  252. data/lib/cucumber/formatters/cucumber.css +0 -132
  253. data/lib/cucumber/formatters/cucumber.js +0 -11
  254. data/lib/cucumber/formatters/html_formatter.rb +0 -151
  255. data/lib/cucumber/formatters/jquery.js +0 -32
  256. data/lib/cucumber/formatters/pretty_formatter.rb +0 -285
  257. data/lib/cucumber/formatters/profile_formatter.rb +0 -92
  258. data/lib/cucumber/formatters/progress_formatter.rb +0 -61
  259. data/lib/cucumber/model.rb +0 -1
  260. data/lib/cucumber/model/table.rb +0 -32
  261. data/lib/cucumber/step_methods.rb +0 -49
  262. data/lib/cucumber/tree.rb +0 -16
  263. data/lib/cucumber/tree/feature.rb +0 -105
  264. data/lib/cucumber/tree/features.rb +0 -21
  265. data/lib/cucumber/tree/given_scenario.rb +0 -13
  266. data/lib/cucumber/tree/scenario.rb +0 -240
  267. data/lib/cucumber/tree/step.rb +0 -173
  268. data/lib/cucumber/tree/table.rb +0 -26
  269. data/lib/cucumber/tree/top_down_visitor.rb +0 -23
  270. data/lib/cucumber/treetop_parser/feature.treetop.erb +0 -254
  271. data/lib/cucumber/treetop_parser/feature_ar.rb +0 -1951
  272. data/lib/cucumber/treetop_parser/feature_cy.rb +0 -1951
  273. data/lib/cucumber/treetop_parser/feature_da.rb +0 -1951
  274. data/lib/cucumber/treetop_parser/feature_de.rb +0 -1951
  275. data/lib/cucumber/treetop_parser/feature_en-lol.rb +0 -1951
  276. data/lib/cucumber/treetop_parser/feature_en-tx.rb +0 -1951
  277. data/lib/cucumber/treetop_parser/feature_en.rb +0 -1951
  278. data/lib/cucumber/treetop_parser/feature_es.rb +0 -1951
  279. data/lib/cucumber/treetop_parser/feature_et.rb +0 -1951
  280. data/lib/cucumber/treetop_parser/feature_fr.rb +0 -1951
  281. data/lib/cucumber/treetop_parser/feature_id.rb +0 -1951
  282. data/lib/cucumber/treetop_parser/feature_it.rb +0 -1951
  283. data/lib/cucumber/treetop_parser/feature_ja.rb +0 -1951
  284. data/lib/cucumber/treetop_parser/feature_ko.rb +0 -1951
  285. data/lib/cucumber/treetop_parser/feature_lt.rb +0 -1951
  286. data/lib/cucumber/treetop_parser/feature_nl.rb +0 -1951
  287. data/lib/cucumber/treetop_parser/feature_no.rb +0 -1951
  288. data/lib/cucumber/treetop_parser/feature_parser.rb +0 -36
  289. data/lib/cucumber/treetop_parser/feature_pl.rb +0 -1951
  290. data/lib/cucumber/treetop_parser/feature_pt.rb +0 -1951
  291. data/lib/cucumber/treetop_parser/feature_ro.rb +0 -1951
  292. data/lib/cucumber/treetop_parser/feature_ro2.rb +0 -1951
  293. data/lib/cucumber/treetop_parser/feature_ru.rb +0 -1951
  294. data/lib/cucumber/treetop_parser/feature_se.rb +0 -1951
  295. data/lib/cucumber/treetop_parser/feature_zh-CN.rb +0 -1951
  296. data/lib/cucumber/world/pending.rb +0 -22
  297. data/script/console +0 -10
  298. data/script/console.cmd +0 -1
  299. data/script/destroy +0 -14
  300. data/script/destroy.cmd +0 -1
  301. data/script/generate +0 -14
  302. data/script/generate.cmd +0 -1
  303. data/script/txt2html +0 -74
  304. data/script/txt2html.cmd +0 -1
  305. data/setup.rb +0 -1585
  306. data/spec/cucumber/cli_spec.rb +0 -521
  307. data/spec/cucumber/executor_spec.rb +0 -382
  308. data/spec/cucumber/formatters/autotest_formatter_spec.rb +0 -26
  309. data/spec/cucumber/formatters/features.html +0 -269
  310. data/spec/cucumber/formatters/html_formatter_spec.rb +0 -104
  311. data/spec/cucumber/formatters/pretty_formatter_spec.rb +0 -410
  312. data/spec/cucumber/formatters/progress_formatter_spec.rb +0 -81
  313. data/spec/cucumber/model/table_spec.rb +0 -32
  314. data/spec/cucumber/tree/feature_spec.rb +0 -122
  315. data/spec/cucumber/tree/row_scenario_outline_spec.rb +0 -73
  316. data/spec/cucumber/tree/row_scenario_spec.rb +0 -55
  317. data/spec/cucumber/tree/row_step_outline_spec.rb +0 -38
  318. data/spec/cucumber/tree/scenario_outline_spec.rb +0 -50
  319. data/spec/cucumber/tree/scenario_spec.rb +0 -134
  320. data/spec/cucumber/tree/step_outline_spec.rb +0 -17
  321. data/spec/cucumber/tree/step_spec.rb +0 -59
  322. data/spec/cucumber/treetop_parser/feature_parser_spec.rb +0 -120
@@ -9,6 +9,10 @@ Feature: Cucumber
9
9
  Scenario: Call step from step
10
10
  Given nested step is called
11
11
  Then nested step should be executed
12
+
13
+ Scenario: Call step from step using text table
14
+ Given nested step is called using text table
15
+ Then nested step should be executed
12
16
 
13
17
  Scenario: Reading a table
14
18
  Given the following table
@@ -16,7 +20,7 @@ Feature: Cucumber
16
20
  | Oslo | London |
17
21
  Then I should be working in London
18
22
  And I should be born in Oslo
19
- And I shoule see a multiline string like
23
+ And I should see a multiline string like
20
24
  """
21
25
  A string
22
26
  that spans
@@ -0,0 +1,221 @@
1
+ Feature: backgrounds
2
+ In order to provide a context to my scenarios within a feature
3
+ As a feature editor
4
+ I want to write a background section in my features.
5
+
6
+ Scenario: run a specific scenario with a background
7
+ When I run cucumber -q features/background/passing_background.feature:9 --require features
8
+ Then it should pass with
9
+ """
10
+ Feature: Passing background sample
11
+
12
+ Background:
13
+ Given '10' cukes
14
+
15
+ Scenario: another passing background
16
+ Then I should have '10' cukes
17
+
18
+ 1 scenario
19
+ 3 passed steps
20
+
21
+ """
22
+
23
+ Scenario: run a feature with a background that passes
24
+ When I run cucumber -q features/background/passing_background.feature --require features
25
+ Then it should pass with
26
+ """
27
+ Feature: Passing background sample
28
+
29
+ Background:
30
+ Given '10' cukes
31
+
32
+ Scenario: passing background
33
+ Then I should have '10' cukes
34
+
35
+ Scenario: another passing background
36
+ Then I should have '10' cukes
37
+
38
+ 2 scenarios
39
+ 4 passed steps
40
+
41
+ """
42
+
43
+ Scenario: run a feature with scenario outlines that has a background that passes
44
+ When I run cucumber -q features/background/scenario_outline_passing_background.feature --require features
45
+ Then it should pass with
46
+ """
47
+ Feature: Passing background with scenario outlines sample
48
+
49
+ Background:
50
+ Given '10' cukes
51
+
52
+ Scenario Outline: passing background
53
+ Then I should have '<count>' cukes
54
+
55
+ Examples:
56
+ | count |
57
+ | 10 |
58
+
59
+ Scenario Outline: another passing background
60
+ Then I should have '<count>' cukes
61
+
62
+ Examples:
63
+ | count |
64
+ | 10 |
65
+
66
+ 2 scenarios
67
+ 5 passed steps
68
+
69
+ """
70
+
71
+ Scenario: run a feature with a background that fails
72
+ When I run cucumber -q features/background/failing_background.feature --require features
73
+ Then it should fail with
74
+ """
75
+ Feature: Failing background sample
76
+
77
+ Background:
78
+ Given failing without a table
79
+ FAIL (RuntimeError)
80
+ ./features/step_definitions/sample_steps.rb:2:in `flunker'
81
+ ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
82
+ features/background/failing_background.feature:4:in `Given failing without a table'
83
+ And '10' cukes
84
+
85
+ Scenario: failing background
86
+ Then I should have '10' cukes
87
+
88
+ Scenario: another failing background
89
+ Then I should have '10' cukes
90
+
91
+ 2 scenarios
92
+ 1 failed step
93
+ 5 skipped steps
94
+
95
+ """
96
+
97
+ Scenario: run a feature with scenario outlines that has a background that fails
98
+ When I run cucumber -q features/background/scenario_outline_failing_background.feature --require features
99
+ Then it should fail with
100
+ """
101
+ Feature: Failing background with scenario outlines sample
102
+
103
+ Background:
104
+ Given failing without a table
105
+ FAIL (RuntimeError)
106
+ ./features/step_definitions/sample_steps.rb:2:in `flunker'
107
+ ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
108
+ features/background/scenario_outline_failing_background.feature:4:in `Given failing without a table'
109
+
110
+ Scenario Outline: failing background
111
+ Then I should have '<count>' cukes
112
+
113
+ Examples:
114
+ | count |
115
+ | 10 |
116
+
117
+ Scenario Outline: another failing background
118
+ Then I should have '<count>' cukes
119
+
120
+ Examples:
121
+ | count |
122
+ | 10 |
123
+
124
+ 2 scenarios
125
+ 1 failed step
126
+ 4 skipped steps
127
+
128
+ """
129
+
130
+ Scenario: run a feature with a background that is pending
131
+ When I run cucumber -q features/background/pending_background.feature --require features
132
+ Then it should pass with
133
+ """
134
+ Feature: Pending background sample
135
+
136
+ Background:
137
+ Given pending
138
+
139
+ Scenario: pending background
140
+ Then I should have '10' cukes
141
+
142
+ Scenario: another pending background
143
+ Then I should have '10' cukes
144
+
145
+ 2 scenarios
146
+ 2 skipped steps
147
+ 2 undefined steps
148
+
149
+ """
150
+
151
+ Scenario: background passes with first scenario but fails with second
152
+ When I run cucumber -q features/background/failing_background_after_success.feature --require features
153
+ Then it should fail with
154
+ """
155
+ Feature: Failing background after previously successful background sample
156
+
157
+ Background:
158
+ Given passing without a table
159
+ And '10' global cukes
160
+
161
+ Scenario: passing background
162
+ Then I should have '10' global cukes
163
+
164
+ Scenario: failing background
165
+ And '10' global cukes
166
+ FAIL (RuntimeError)
167
+ ./features/step_definitions/sample_steps.rb:2:in `flunker'
168
+ ./features/step_definitions/sample_steps.rb:37:in `/^'(.+)' global cukes$/'
169
+ features/background/failing_background_after_success.feature:5:in `And '10' global cukes'
170
+ Then I should have '10' global cukes
171
+
172
+ 2 scenarios
173
+ 1 failed step
174
+ 1 skipped step
175
+ 4 passed steps
176
+
177
+ """
178
+
179
+ Scenario: background with multline args
180
+ When I run cucumber -q features/background/multiline_args_background.feature --require features
181
+ Then it should pass with
182
+ """
183
+ Feature: Passing background with multiline args
184
+
185
+ Background:
186
+ Given table
187
+ | a | b |
188
+ | c | d |
189
+ And multiline string
190
+ \"\"\"
191
+ I'm a cucumber and I'm okay.
192
+ I sleep all night and I test all day
193
+ \"\"\"
194
+
195
+ Scenario: passing background
196
+ Then the table should be
197
+ | a | b |
198
+ | c | d |
199
+ Then the multiline string should be
200
+ \"\"\"
201
+ I'm a cucumber and I'm okay.
202
+ I sleep all night and I test all day
203
+ \"\"\"
204
+
205
+ Scenario: another passing background
206
+ Then the table should be
207
+ | a | b |
208
+ | c | d |
209
+ Then the multiline string should be
210
+ \"\"\"
211
+ I'm a cucumber and I'm okay.
212
+ I sleep all night and I test all day
213
+ \"\"\"
214
+
215
+ 2 scenarios
216
+ 8 passed steps
217
+
218
+ """
219
+
220
+ @josephwilk
221
+ Scenario: run a scenario showing explicit background steps --explicit-background
@@ -1,99 +1,118 @@
1
1
  Feature: Cucumber command line
2
2
  In order to write better software
3
3
  Developers should be able to execute requirements as tests
4
-
4
+
5
5
  Scenario: Run single scenario with missing step definition
6
- When I run cucumber -q features/sample.feature:3
7
- Then it should pass with
6
+ When I run cucumber -q features/sample.feature:5
7
+ Then it should pass with
8
8
  """
9
+ @one
9
10
  Feature: Sample
11
+
12
+ @two @three
10
13
  Scenario: Missing
11
14
  Given missing
12
15
 
13
-
14
16
  1 scenario
15
- 1 step pending (1 with no step definition)
16
-
17
+ 1 undefined step
18
+
17
19
  """
18
-
19
- Scenario: Run single failing scenario
20
- When I run cucumber -q features/sample.feature:12
20
+
21
+ Scenario: Fail with --strict
22
+ When I run cucumber -q features/sample.feature:5 --strict
21
23
  Then it should fail with
22
24
  """
25
+ @one
23
26
  Feature: Sample
24
- Scenario: Failing
25
- Given failing
26
- FAIL (RuntimeError)
27
- ./features/step_definitions/sample_steps.rb:5:in `Given /^failing$/'
28
- features/sample.feature:12:in `Given failing'
29
27
 
28
+ @two @three
29
+ Scenario: Missing
30
+ Given missing
31
+ Undefined step: "missing" (Cucumber::Undefined)
32
+ features/sample.feature:6:in `Given missing'
30
33
 
31
34
  1 scenario
32
- 1 step failed
35
+ 1 undefined step
33
36
 
34
37
  """
35
38
 
36
- Scenario: Specify 2 line numbers
37
- When I run cucumber -q features/sample.feature:3:12
39
+ Scenario: Succeed with --strict
40
+ When I run cucumber -q features/sample.feature:9 --strict
41
+ Then it should pass with
42
+ """
43
+ @one
44
+ Feature: Sample
45
+
46
+ @three
47
+ Scenario: Passing
48
+ Given passing
49
+ | a | b |
50
+ | c | d |
51
+
52
+ 1 scenario
53
+ 1 passed step
54
+
55
+ """
56
+
57
+ Scenario: Specify 2 line numbers where one is a tag
58
+ When I run cucumber -q features/sample.feature:5:14
38
59
  Then it should fail with
39
60
  """
61
+ @one
40
62
  Feature: Sample
63
+
64
+ @two @three
41
65
  Scenario: Missing
42
66
  Given missing
43
67
 
68
+ @four
44
69
  Scenario: Failing
45
70
  Given failing
71
+ \"\"\"
72
+ hello
73
+ \"\"\"
46
74
  FAIL (RuntimeError)
47
- ./features/step_definitions/sample_steps.rb:5:in `Given /^failing$/'
48
- features/sample.feature:12:in `Given failing'
49
-
75
+ ./features/step_definitions/sample_steps.rb:2:in `flunker'
76
+ ./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
77
+ features/sample.feature:16:in `Given failing'
50
78
 
51
79
  2 scenarios
52
- 1 step failed
53
- 1 step pending (1 with no step definition)
80
+ 1 failed step
81
+ 1 undefined step
54
82
 
55
83
  """
56
84
 
57
-
58
85
  Scenario: Require missing step definition from elsewhere
59
- When I run cucumber -q -r ../../features/step_definitions/extra_steps.rb features/sample.feature:3
86
+ When I run cucumber -q -r ../../features/step_definitions/extra_steps.rb features/sample.feature:5
60
87
  Then it should pass with
61
88
  """
89
+ @one
62
90
  Feature: Sample
91
+
92
+ @two @three
63
93
  Scenario: Missing
64
94
  Given missing
65
95
 
66
-
67
96
  1 scenario
68
- 1 step passed
69
-
70
- """
71
-
72
- Scenario: Specify the line number of a blank line
73
- When I run cucumber -q features/sample.feature:10
74
- Then it should pass with
75
- """
76
- Feature: Sample
77
- Scenario: Passing
78
- Given passing
79
-
80
-
81
- 1 scenario
82
- 1 step passed
97
+ 1 passed step
83
98
 
84
99
  """
85
100
 
86
101
  Scenario: Specify the line number of a row
87
- When I run cucumber -q features/sample.feature:8
102
+ When I run cucumber -q features/sample.feature:12
88
103
  Then it should pass with
89
104
  """
105
+ @one
90
106
  Feature: Sample
107
+
108
+ @three
91
109
  Scenario: Passing
92
110
  Given passing
93
-
111
+ | a | b |
112
+ | c | d |
94
113
 
95
114
  1 scenario
96
- 1 step passed
115
+ 1 passed step
97
116
 
98
117
  """
99
118
 
@@ -101,19 +120,19 @@ Feature: Cucumber command line
101
120
  When I run cucumber -q --format progress features/sample.feature
102
121
  Then it should fail with
103
122
  """
104
- P.F
123
+ U.F
105
124
 
106
- Pending Scenarios:
107
-
108
- 1) Sample (Missing)
109
-
110
-
111
- Failed:
112
-
113
- 1)
114
- FAIL
115
- ./features/step_definitions/sample_steps.rb:5:in `Given /^failing$/'
116
- features/sample.feature:12:in `Given failing'
125
+ (::) failed steps (::)
126
+
127
+ FAIL (RuntimeError)
128
+ ./features/step_definitions/sample_steps.rb:2:in `flunker'
129
+ ./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
130
+ features/sample.feature:16:in `Given failing'
131
+
132
+ 3 scenarios
133
+ 1 failed step
134
+ 1 undefined step
135
+ 1 passed step
117
136
 
118
137
  """
119
138
 
@@ -126,12 +145,14 @@ Feature: Cucumber command line
126
145
  For å slippe å gjøre dumme feil
127
146
  Som en regnskapsfører
128
147
  Vil jeg kunne legge sammen
148
+
129
149
  Scenario: to tall
130
150
  Gitt at jeg har tastet inn 5
131
151
  Og at jeg har tastet inn 7
132
152
  Når jeg summerer
133
153
  Så skal resultatet være 12
134
154
 
155
+ @iterasjon3
135
156
  Scenario: tre tall
136
157
  Gitt at jeg har tastet inn 5
137
158
  Og at jeg har tastet inn 7
@@ -139,85 +160,230 @@ Feature: Cucumber command line
139
160
  Når jeg summerer
140
161
  Så skal resultatet være 13
141
162
 
142
-
143
163
  2 scenarios
144
- 9 steps passed
164
+ 9 passed steps
145
165
 
146
166
  """
147
167
 
148
168
  Scenario: --dry-run
149
- When I run cucumber --dry-run features
169
+ When I run cucumber --dry-run --no-snippets features/*.feature
150
170
  Then it should pass with
151
171
  """
152
- Feature: Outline Sample # features/outline_sample.feature
153
- Scenario Outline: Test state # features/outline_sample.feature:3
154
- Given <state> without a table # features/outline_sample.feature:4
172
+ Feature: Calling undefined step
173
+
174
+ Scenario: Call directly
175
+ Given a step definition that calls an undefined step
176
+
177
+ Scenario: Call via another
178
+ Given call step "a step definition that calls an undefined step"
179
+
180
+ Feature: Failing expectation
181
+
182
+ Scenario: Failing expectation
183
+ Given failing expectation
184
+
185
+ Feature: Lots of undefined
186
+
187
+ Scenario: Implement me
188
+ Given it snows in Sahara
189
+ Given it's 40 degrees in Norway
190
+ And it's 40 degrees in Norway
191
+ When I stop procrastinating
192
+ And there is world peace
193
+
194
+ Feature: Outline Sample
155
195
 
156
- |state |
157
- |missing|
158
- |passing|
159
- |failing|
196
+ Scenario: I have no steps
160
197
 
161
- Feature: Sample # features/sample.feature
198
+ Scenario Outline: Test state
199
+ Given <state> without a table
200
+ Given <other_state> without a table
162
201
 
163
- Scenario: Missing # features/sample.feature:3
164
- Given missing # other.rb:23
202
+ Examples: Rainbow colours
203
+ | state | other_state |
204
+ | missing | passing |
205
+ | passing | passing |
206
+ | failing | passing |
165
207
 
166
- Scenario: Passing # features/sample.feature:6
167
- Given passing # features/step_definitions/sample_steps.rb:1
208
+ Examples: Only passing
209
+ | state | other_state |
210
+ | passing | passing |
168
211
 
169
- Scenario: Failing # features/sample.feature:11
170
- Given failing # features/step_definitions/sample_steps.rb:4
212
+ @one
213
+ Feature: Sample
214
+
215
+ @two @three
216
+ Scenario: Missing
217
+ Given missing
171
218
 
219
+ @three
220
+ Scenario: Passing
221
+ Given passing
222
+ | a | b |
223
+ | c | d |
172
224
 
173
- 7 scenarios
174
- 6 steps passed
225
+ @four
226
+ Scenario: Failing
227
+ Given failing
228
+ \"\"\"
229
+ hello
230
+ \"\"\"
231
+
232
+ 12 scenarios
233
+ 12 skipped steps
234
+ 7 undefined steps
175
235
 
176
236
  """
177
237
 
178
238
  Scenario: Multiple formatters and outputs
179
- When I run cucumber --format progress --out tmp/progress.txt --format html --out tmp/features.html features
180
- Then it should fail with
239
+ When I run cucumber --format progress --out tmp/progress.txt --format pretty --out tmp/pretty.txt --dry-run features/lots_of_undefined.feature
240
+ And examples/self_test/tmp/progress.txt should contain
181
241
  """
242
+ UUUUU
243
+
244
+ 1 scenario
245
+ 5 undefined steps
246
+
182
247
  """
183
- And examples/self_test/tmp/progress.txt should contain
248
+ And examples/self_test/tmp/pretty.txt should match
184
249
  """
185
- P.FP.F
250
+ Feature: Lots of undefined
186
251
 
187
- Pending Scenarios:
252
+ Scenario: Implement me
253
+ Given it snows in Sahara
254
+ Given it's 40 degrees in Norway
255
+ And it's 40 degrees in Norway
256
+ When I stop procrastinating
257
+ And there is world peace
188
258
 
189
- 1) Outline Sample (Test state)
190
- 2) Sample (Missing)
259
+ 1 scenario
260
+ 5 undefined steps
191
261
 
262
+ """
192
263
 
193
- Failed:
264
+ Scenario: Run scenario specified by name using --scenario
265
+ When I run cucumber --scenario Passing -q features
266
+ Then it should pass with
267
+ """
268
+ @one
269
+ Feature: Sample
194
270
 
195
- 1)
196
- FAIL
197
- ./features/step_definitions/sample_steps.rb:12:in ` /^failing without a table$/'
198
- features/outline_sample.feature:9:in `/^failing without a table$/'
271
+ @three
272
+ Scenario: Passing
273
+ Given passing
274
+ | a | b |
275
+ | c | d |
199
276
 
200
- 2)
201
- FAIL
202
- ./features/step_definitions/sample_steps.rb:5:in `Given /^failing$/'
203
- features/sample.feature:12:in `Given failing'
277
+ 1 scenario
278
+ 1 passed step
204
279
 
205
280
  """
206
- And examples/self_test/tmp/features.html should match
281
+
282
+ Scenario: Run with a tag that exists on 2 scenarios
283
+ When I run cucumber -q features --tags three
284
+ Then it should pass with
207
285
  """
208
- Given passing
286
+ @one
287
+ Feature: Sample
288
+
289
+ @two @three
290
+ Scenario: Missing
291
+ Given missing
292
+
293
+ @three
294
+ Scenario: Passing
295
+ Given passing
296
+ | a | b |
297
+ | c | d |
298
+
299
+ 2 scenarios
300
+ 1 undefined step
301
+ 1 passed step
302
+
209
303
  """
210
-
211
- Scenario: Run scenario specified by name using --scenario
212
- When I run cucumber --scenario Passing -q features/sample.feature
304
+
305
+ Scenario: Run with a tag that exists on 1 feature
306
+ When I run cucumber -q features --tags one
307
+ Then it should fail with
308
+ """
309
+ @one
310
+ Feature: Sample
311
+
312
+ @two @three
313
+ Scenario: Missing
314
+ Given missing
315
+
316
+ @three
317
+ Scenario: Passing
318
+ Given passing
319
+ | a | b |
320
+ | c | d |
321
+
322
+ @four
323
+ Scenario: Failing
324
+ Given failing
325
+ \"\"\"
326
+ hello
327
+ \"\"\"
328
+ FAIL (RuntimeError)
329
+ ./features/step_definitions/sample_steps.rb:2:in `flunker'
330
+ ./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
331
+ features/sample.feature:16:in `Given failing'
332
+
333
+ 3 scenarios
334
+ 1 failed step
335
+ 1 undefined step
336
+ 1 passed step
337
+
338
+ """
339
+
340
+ Scenario: Run with a negative tag
341
+ When I run cucumber -q features/sample.feature --dry-run -t ~four
213
342
  Then it should pass with
214
343
  """
344
+ @one
215
345
  Feature: Sample
346
+
347
+ @two @three
348
+ Scenario: Missing
349
+ Given missing
350
+
351
+ @three
216
352
  Scenario: Passing
217
353
  Given passing
354
+ | a | b |
355
+ | c | d |
218
356
 
357
+ 2 scenarios
358
+ 1 skipped step
359
+ 1 undefined step
219
360
 
220
- 1 scenario
221
- 1 step passed
361
+ """
222
362
 
363
+ Scenario: Reformat files with --autoformat
364
+ When I run cucumber --autoformat tmp/formatted features
365
+ Then examples/self_test/tmp/formatted/features/sample.feature should contain
223
366
  """
367
+ @one
368
+ Feature: Sample
369
+
370
+ @two @three
371
+ Scenario: Missing
372
+ Given missing
373
+
374
+ @three
375
+ Scenario: Passing
376
+ Given passing
377
+ | a | b |
378
+ | c | d |
379
+
380
+ @four
381
+ Scenario: Failing
382
+ Given failing
383
+ \"\"\"
384
+ hello
385
+ \"\"\"
386
+
387
+
388
+ """
389
+