cucumber 0.8.5 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. data/.rspec +1 -1
  2. data/LICENSE +1 -1
  3. data/Rakefile +5 -51
  4. data/bin/cucumber +7 -1
  5. data/cucumber.gemspec +463 -679
  6. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -1
  7. data/examples/i18n/he/features/step_definitons/calculator_steps.rb +1 -1
  8. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +4 -7
  9. data/examples/i18n/ru/features/division.feature +2 -2
  10. data/examples/i18n/tr/features/step_definitons/hesap_makinesi_adimlari.rb +3 -3
  11. data/examples/sinatra/features/support/env.rb +2 -5
  12. data/examples/v8/features/fibonacci.feature +1 -1
  13. data/examples/watir/features/step_definitions/search_steps.rb +1 -1
  14. data/features/background.feature +284 -95
  15. data/features/custom_formatter.feature +3 -73
  16. data/features/json_formatter.feature +160 -245
  17. data/features/step_definitions/cucumber_steps.rb +7 -153
  18. data/features/support/env.rb +18 -140
  19. data/fixtures/junit/features/pending.feature +3 -1
  20. data/fixtures/self_test/features/support/env.rb +8 -0
  21. data/fixtures/tickets/features.html +1 -1
  22. data/gem_tasks/examples.rake +1 -1
  23. data/lib/cucumber.rb +12 -0
  24. data/lib/cucumber/ast.rb +1 -1
  25. data/lib/cucumber/ast/background.rb +21 -5
  26. data/lib/cucumber/ast/examples.rb +12 -4
  27. data/lib/cucumber/ast/feature.rb +13 -5
  28. data/lib/cucumber/ast/feature_element.rb +9 -4
  29. data/lib/cucumber/ast/outline_table.rb +4 -4
  30. data/lib/cucumber/ast/scenario.rb +7 -5
  31. data/lib/cucumber/ast/scenario_outline.rb +23 -15
  32. data/lib/cucumber/ast/step.rb +5 -0
  33. data/lib/cucumber/ast/step_invocation.rb +21 -15
  34. data/lib/cucumber/ast/table.rb +14 -8
  35. data/lib/cucumber/ast/tree_walker.rb +10 -48
  36. data/lib/cucumber/cli/configuration.rb +33 -8
  37. data/lib/cucumber/cli/main.rb +20 -35
  38. data/lib/cucumber/cli/options.rb +8 -7
  39. data/lib/cucumber/cli/profile_loader.rb +2 -0
  40. data/lib/cucumber/core_ext/proc.rb +2 -1
  41. data/lib/cucumber/feature_file.rb +47 -15
  42. data/lib/cucumber/formatter/ansicolor.rb +3 -5
  43. data/lib/cucumber/formatter/console.rb +27 -23
  44. data/lib/cucumber/formatter/cucumber.css +34 -17
  45. data/lib/cucumber/formatter/cucumber.sass +173 -182
  46. data/lib/cucumber/formatter/html.rb +46 -11
  47. data/lib/cucumber/formatter/io.rb +2 -4
  48. data/lib/cucumber/formatter/json.rb +15 -152
  49. data/lib/cucumber/formatter/json_pretty.rb +5 -6
  50. data/lib/cucumber/formatter/junit.rb +28 -22
  51. data/lib/cucumber/formatter/pdf.rb +6 -6
  52. data/lib/cucumber/formatter/pretty.rb +5 -5
  53. data/lib/cucumber/formatter/rerun.rb +22 -11
  54. data/lib/cucumber/formatter/unicode.rb +41 -20
  55. data/lib/cucumber/js_support/js_dsl.js +4 -4
  56. data/lib/cucumber/js_support/js_language.rb +9 -5
  57. data/lib/cucumber/js_support/js_snippets.rb +2 -2
  58. data/lib/cucumber/language_support.rb +2 -2
  59. data/lib/cucumber/parser/gherkin_builder.rb +35 -30
  60. data/lib/cucumber/platform.rb +8 -8
  61. data/lib/cucumber/py_support/py_language.rb +2 -2
  62. data/lib/cucumber/rake/task.rb +80 -31
  63. data/lib/cucumber/rb_support/rb_dsl.rb +1 -0
  64. data/lib/cucumber/rb_support/rb_language.rb +10 -8
  65. data/lib/cucumber/rb_support/rb_step_definition.rb +8 -0
  66. data/lib/cucumber/rb_support/rb_transform.rb +17 -0
  67. data/lib/cucumber/rb_support/rb_world.rb +26 -18
  68. data/lib/cucumber/rspec/doubles.rb +3 -3
  69. data/lib/cucumber/step_match.rb +6 -2
  70. data/lib/cucumber/step_mother.rb +6 -427
  71. data/lib/cucumber/wire_support/configuration.rb +4 -1
  72. data/lib/cucumber/wire_support/wire_language.rb +3 -10
  73. data/spec/cucumber/ast/background_spec.rb +68 -6
  74. data/spec/cucumber/ast/feature_factory.rb +5 -4
  75. data/spec/cucumber/ast/feature_spec.rb +4 -4
  76. data/spec/cucumber/ast/outline_table_spec.rb +1 -1
  77. data/spec/cucumber/ast/scenario_outline_spec.rb +15 -11
  78. data/spec/cucumber/ast/scenario_spec.rb +4 -4
  79. data/spec/cucumber/ast/step_spec.rb +3 -3
  80. data/spec/cucumber/ast/table_spec.rb +38 -2
  81. data/spec/cucumber/ast/tree_walker_spec.rb +2 -2
  82. data/spec/cucumber/broadcaster_spec.rb +1 -1
  83. data/spec/cucumber/cli/configuration_spec.rb +32 -6
  84. data/spec/cucumber/cli/drb_client_spec.rb +2 -3
  85. data/spec/cucumber/cli/main_spec.rb +43 -43
  86. data/spec/cucumber/cli/options_spec.rb +28 -1
  87. data/spec/cucumber/cli/profile_loader_spec.rb +1 -1
  88. data/spec/cucumber/core_ext/proc_spec.rb +1 -1
  89. data/spec/cucumber/formatter/ansicolor_spec.rb +1 -1
  90. data/spec/cucumber/formatter/duration_spec.rb +1 -1
  91. data/spec/cucumber/formatter/html_spec.rb +3 -5
  92. data/spec/cucumber/formatter/junit_spec.rb +16 -2
  93. data/spec/cucumber/formatter/progress_spec.rb +1 -1
  94. data/spec/cucumber/formatter/spec_helper.rb +11 -12
  95. data/spec/cucumber/rb_support/rb_language_spec.rb +241 -28
  96. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +33 -28
  97. data/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb +1 -1
  98. data/spec/cucumber/step_match_spec.rb +11 -9
  99. data/spec/cucumber/wire_support/configuration_spec.rb +1 -1
  100. data/spec/cucumber/wire_support/connection_spec.rb +1 -1
  101. data/spec/cucumber/wire_support/wire_exception_spec.rb +1 -1
  102. data/spec/cucumber/wire_support/wire_language_spec.rb +1 -1
  103. data/spec/cucumber/wire_support/wire_packet_spec.rb +1 -1
  104. data/spec/cucumber/wire_support/wire_step_definition_spec.rb +1 -1
  105. data/spec/cucumber/world/pending_spec.rb +2 -2
  106. data/spec/spec_helper.rb +13 -20
  107. metadata +11 -222
  108. data/.gitignore +0 -20
  109. data/Caliper.yml +0 -4
  110. data/History.txt +0 -1552
  111. data/README.rdoc +0 -26
  112. data/VERSION.yml +0 -5
  113. data/examples/i18n/ro/features/suma.feature +0 -11
  114. data/features/announce.feature +0 -164
  115. data/features/around_hooks.feature +0 -232
  116. data/features/bug_371.feature +0 -32
  117. data/features/bug_464.feature +0 -16
  118. data/features/bug_475.feature +0 -42
  119. data/features/bug_585_tab_indentation.feature +0 -22
  120. data/features/bug_600.feature +0 -67
  121. data/features/call_steps_from_stepdefs.feature +0 -154
  122. data/features/cucumber_cli.feature +0 -591
  123. data/features/cucumber_cli_outlines.feature +0 -117
  124. data/features/default_snippets.feature +0 -42
  125. data/features/diffing.feature +0 -25
  126. data/features/drb_server_integration.feature +0 -174
  127. data/features/exception_in_after_block.feature +0 -127
  128. data/features/exception_in_after_step_block.feature +0 -104
  129. data/features/exception_in_before_block.feature +0 -98
  130. data/features/exclude_files.feature +0 -20
  131. data/features/expand.feature +0 -60
  132. data/features/html_formatter.feature +0 -8
  133. data/features/html_formatter/a.html +0 -582
  134. data/features/junit_formatter.feature +0 -88
  135. data/features/language_from_header.feature +0 -30
  136. data/features/language_help.feature +0 -78
  137. data/features/listener_debugger_formatter.feature +0 -42
  138. data/features/multiline_names.feature +0 -44
  139. data/features/negative_tagged_hooks.feature +0 -60
  140. data/features/post_configuration_hook.feature +0 -37
  141. data/features/profiles.feature +0 -126
  142. data/features/rake_task.feature +0 -152
  143. data/features/report_called_undefined_steps.feature +0 -34
  144. data/features/rerun_formatter.feature +0 -45
  145. data/features/simplest.feature +0 -11
  146. data/features/snippet.feature +0 -23
  147. data/features/snippets_when_using_star_keyword.feature +0 -36
  148. data/features/step_definitions/extra_steps.rb +0 -2
  149. data/features/step_definitions/simplest_steps.rb +0 -3
  150. data/features/step_definitions/wire_steps.rb +0 -32
  151. data/features/support/env.rb.simplest +0 -7
  152. data/features/support/fake_wire_server.rb +0 -77
  153. data/features/table_diffing.feature +0 -45
  154. data/features/table_mapping.feature +0 -34
  155. data/features/tag_logic.feature +0 -258
  156. data/features/transform.feature +0 -245
  157. data/features/unicode_table.feature +0 -35
  158. data/features/usage_and_stepdefs_formatter.feature +0 -169
  159. data/features/wire_protocol.feature +0 -332
  160. data/features/wire_protocol_table_diffing.feature +0 -119
  161. data/features/wire_protocol_tags.feature +0 -87
  162. data/features/wire_protocol_timeouts.feature +0 -63
  163. data/features/work_in_progress.feature +0 -156
  164. data/fixtures/json/features/pystring.feature +0 -8
  165. data/fixtures/self_test/features/background/background_tagged_before_on_outline.feature +0 -12
  166. data/fixtures/self_test/features/background/background_with_name.feature +0 -7
  167. data/fixtures/self_test/features/background/failing_background.feature +0 -12
  168. data/fixtures/self_test/features/background/failing_background_after_success.feature +0 -11
  169. data/fixtures/self_test/features/background/multiline_args_background.feature +0 -32
  170. data/fixtures/self_test/features/background/passing_background.feature +0 -10
  171. data/fixtures/self_test/features/background/pending_background.feature +0 -10
  172. data/fixtures/self_test/features/background/scenario_outline_failing_background.feature +0 -16
  173. data/fixtures/self_test/features/background/scenario_outline_passing_background.feature +0 -16
  174. data/gem_tasks/features.rake +0 -14
  175. data/gem_tasks/sdoc.rake +0 -12
  176. data/lib/cucumber/ast/py_string.rb +0 -80
  177. data/lib/cucumber/formatter/color_io.rb +0 -23
  178. data/lib/cucumber/formatter/tag_cloud.rb +0 -35
  179. data/spec/cucumber/ast/py_string_spec.rb +0 -40
  180. data/spec/cucumber/formatter/color_io_spec.rb +0 -29
  181. data/spec/cucumber/step_mother_spec.rb +0 -302
@@ -1,88 +0,0 @@
1
- Feature: JUnit output formatter
2
- In order for developers to create test reports with ant
3
- Cucumber should be able to output JUnit xml files
4
-
5
- Background:
6
- Given I am in junit
7
- And the tmp directory is empty
8
-
9
- Scenario: one feature, one passing scenario, one failing scenario
10
- When I run cucumber --format junit --out tmp/ features/one_passing_one_failing.feature
11
- Then it should fail with
12
- """
13
-
14
- """
15
- And "fixtures/junit/tmp/TEST-one_passing_one_failing.xml" with junit duration "0.005" should contain
16
- """
17
- <?xml version="1.0" encoding="UTF-8"?>
18
- <testsuite errors="0" failures="1" name="One passing scenario, one failing scenario" tests="2" time="0.005">
19
- <testcase classname="One passing scenario, one failing scenario.Passing" name="Passing" time="0.005">
20
- </testcase>
21
- <testcase classname="One passing scenario, one failing scenario.Failing" name="Failing" time="0.005">
22
- <failure message="failed Failing" type="failed">
23
- Scenario: Failing
24
-
25
- Given a failing scenario
26
-
27
- Message:
28
- (RuntimeError)
29
- features/one_passing_one_failing.feature:7:in `Given a failing scenario' </failure>
30
- </testcase>
31
- </testsuite>
32
-
33
- """
34
-
35
- Scenario: pending steps are simply skipped
36
- When I run cucumber --format junit --out tmp/ features/pending.feature
37
- Then it should pass with
38
- """
39
-
40
- """
41
- And "fixtures/junit/tmp/TEST-pending.xml" with junit duration "0.009" should contain
42
- """
43
- <?xml version="1.0" encoding="UTF-8"?>
44
- <testsuite errors="0" failures="0" name="Pending step" tests="0" time="0.009">
45
- </testsuite>
46
-
47
- """
48
-
49
- Scenario: pending step with strict option should fail
50
- When I run cucumber --format junit --out tmp/ features/pending.feature --strict
51
- Then it should fail with
52
- """
53
-
54
- """
55
- And "fixtures/junit/tmp/TEST-pending.xml" with junit duration "0.000160" should contain
56
- """
57
- <?xml version="1.0" encoding="UTF-8"?>
58
- <testsuite errors="0" failures="1" name="Pending step" tests="1" time="0.000160">
59
- <testcase classname="Pending step.Pending" name="Pending" time="0.000160">
60
- <failure message="pending Pending" type="pending">
61
- Scenario: Pending
62
-
63
- TODO (Cucumber::Pending)
64
- features/pending.feature:4:in `Given a pending step' </failure>
65
- </testcase>
66
- </testsuite>
67
-
68
- """
69
-
70
- Scenario: run all features
71
- When I run cucumber --format junit --out tmp/ features
72
- Then it should fail with
73
- """
74
-
75
- """
76
- And "fixtures/junit/tmp/TEST-one_passing_one_failing.xml" should exist
77
- And "fixtures/junit/tmp/TEST-pending.xml" should exist
78
-
79
- Scenario: show correct error message if no --out is passed
80
- When I run cucumber --format junit features
81
- Then STDERR should not match
82
- """
83
- can't convert .* into String \(TypeError\)
84
- """
85
- And STDERR should match
86
- """
87
- You \*must\* specify \-\-out DIR for the junit formatter
88
- """
@@ -1,30 +0,0 @@
1
- Feature: Language from header
2
- In order to simplify command line and
3
- settings in IDEs, Cucumber should pick
4
- up parser language from a header.
5
-
6
- Scenario: LOLCAT
7
- Given a standard Cucumber project directory structure
8
- And a file named "features/lolcat.feature" with:
9
- """
10
- # language: en-lol
11
- OH HAI: STUFFING
12
- B4: HUNGRY
13
- MISHUN: CUKES
14
- DEN KTHXBAI
15
- """
16
- When I run cucumber -i features/lolcat.feature
17
- Then it should pass with
18
- """
19
- # language: en-lol
20
- OH HAI: STUFFING
21
-
22
- B4: HUNGRY # features/lolcat.feature:3
23
-
24
- MISHUN: CUKES # features/lolcat.feature:4
25
- DEN KTHXBAI # features/lolcat.feature:5
26
-
27
- 1 scenario (1 undefined)
28
- 1 step (1 undefined)
29
-
30
- """
@@ -1,78 +0,0 @@
1
- @needs-many-fonts
2
- Feature: Language help
3
- In order to figure out the keywords to use for a language
4
- I want to be able to get help on the language from the CLI
5
-
6
- Scenario: Get help for Portuguese language
7
- When I run cucumber --i18n pt help
8
- Then it should pass with
9
- """
10
- | feature | "Funcionalidade" |
11
- | background | "Contexto" |
12
- | scenario | "Cenário", "Cenario" |
13
- | scenario_outline | "Esquema do Cenário", "Esquema do Cenario" |
14
- | examples | "Exemplos" |
15
- | given | "* ", "Dado " |
16
- | when | "* ", "Quando " |
17
- | then | "* ", "Então ", "Entao " |
18
- | and | "* ", "E " |
19
- | but | "* ", "Mas " |
20
- | given (code) | "Dado" |
21
- | when (code) | "Quando" |
22
- | then (code) | "Então", "Entao" |
23
- | and (code) | "E" |
24
- | but (code) | "Mas" |
25
-
26
- """
27
- Scenario: List languages
28
- When I run cucumber --i18n help
29
- Then STDERR should be empty
30
- Then it should pass with
31
- """
32
- | ar | Arabic | العربية |
33
- | bg | Bulgarian | български |
34
- | ca | Catalan | català |
35
- | cs | Czech | Česky |
36
- | cy-GB | Welsh | Cymraeg |
37
- | da | Danish | dansk |
38
- | de | German | Deutsch |
39
- | en | English | English |
40
- | en-Scouse | Scouse | Scouse |
41
- | en-au | Australian | Australian |
42
- | en-lol | LOLCAT | LOLCAT |
43
- | en-pirate | Pirate | Pirate |
44
- | en-tx | Texan | Texan |
45
- | eo | Esperanto | Esperanto |
46
- | es | Spanish | español |
47
- | et | Estonian | eesti keel |
48
- | fi | Finnish | suomi |
49
- | fr | French | français |
50
- | he | Hebrew | עברית |
51
- | hr | Croatian | hrvatski |
52
- | hu | Hungarian | magyar |
53
- | id | Indonesian | Bahasa Indonesia |
54
- | it | Italian | italiano |
55
- | ja | Japanese | 日本語 |
56
- | ko | Korean | 한국어 |
57
- | lt | Lithuanian | lietuvių kalba |
58
- | lu | Luxemburgish | Lëtzebuergesch |
59
- | lv | Latvian | latviešu |
60
- | nl | Dutch | Nederlands |
61
- | no | Norwegian | norsk |
62
- | pl | Polish | polski |
63
- | pt | Portuguese | português |
64
- | ro | Romanian | română |
65
- | ro-RO | Romanian (diacritical) | română (diacritical) |
66
- | ru | Russian | русский |
67
- | sk | Slovak | Slovensky |
68
- | sr-Cyrl | Serbian | Српски |
69
- | sr-Latn | Serbian (Latin) | Srpski (Latinica) |
70
- | sv | Swedish | Svenska |
71
- | tr | Turkish | Türkçe |
72
- | uk | Ukrainian | Українська |
73
- | uz | Uzbek | Узбекча |
74
- | vi | Vietnamese | Tiếng Việt |
75
- | zh-CN | Chinese simplified | 简体中文 |
76
- | zh-TW | Chinese traditional | 繁體中文 |
77
-
78
- """
@@ -1,42 +0,0 @@
1
- Feature: Listener Debugger
2
- In order to easily visualise the listener API
3
- As a developer
4
- I want a formatter that prints the calls to the listener as a feature is run
5
-
6
- Background:
7
- Given a standard Cucumber project directory structure
8
-
9
- Scenario: title
10
- Given a file named "features/sample.feature" with:
11
- """
12
- Feature: Sample
13
-
14
- Scenario: Sample
15
- Given Sample
16
-
17
- """
18
- When I run cucumber -f debug features/sample.feature
19
- Then STDERR should be empty
20
- Then it should pass with
21
- """
22
- before_features
23
- before_feature
24
- before_tags
25
- after_tags
26
- feature_name
27
- before_feature_element
28
- before_tags
29
- after_tags
30
- scenario_name
31
- before_steps
32
- before_step
33
- before_step_result
34
- step_name
35
- after_step_result
36
- after_step
37
- after_steps
38
- after_feature_element
39
- after_feature
40
- after_features
41
-
42
- """
@@ -1,44 +0,0 @@
1
- Feature: Multiline description names
2
- In order to accurately document feature elements
3
- As a cucumberist
4
- I want to have multiline names
5
-
6
- Scenario: multiline scenario
7
- When I run cucumber features/multiline_name.feature --no-snippets
8
- Then STDERR should be empty
9
- Then it should pass with
10
- """
11
- Feature: multiline
12
-
13
- Background: I'm a multiline name # features/multiline_name.feature:3
14
- which goes on and on and on for three lines
15
- yawn
16
- Given passing without a table # features/step_definitions/sample_steps.rb:12
17
-
18
- Scenario: I'm a multiline name # features/multiline_name.feature:8
19
- which goes on and on and on for three lines
20
- yawn
21
- Given passing without a table # features/step_definitions/sample_steps.rb:12
22
-
23
- Scenario Outline: I'm a multiline name # features/multiline_name.feature:13
24
- which goes on and on and on for three lines
25
- yawn
26
- Given <state> without a table # features/step_definitions/sample_steps.rb:12
27
-
28
- Examples:
29
- | state |
30
- | passing |
31
-
32
- Scenario Outline: name # features/multiline_name.feature:21
33
- Given <state> without a table # features/step_definitions/sample_steps.rb:12
34
-
35
- Examples: I'm a multiline name
36
- which goes on and on and on for three lines
37
- yawn
38
- | state |
39
- | passing |
40
-
41
- 3 scenarios (3 passed)
42
- 6 steps (6 passed)
43
-
44
- """
@@ -1,60 +0,0 @@
1
- Feature: Tagged hooks
2
-
3
- Background:
4
- Given a standard Cucumber project directory structure
5
- And a file named "features/step_definitions/steps.rb" with:
6
- """
7
- Given /^this step works$/ do; end
8
- """
9
- And a file named "features/support/hooks.rb" with:
10
- """
11
- Before('~@no-boom') do
12
- raise 'boom'
13
- end
14
- """
15
- And a file named "features/f.feature" with:
16
- """
17
- Feature: With and without hooks
18
- Scenario: using hook
19
- Given this step works
20
-
21
- @no-boom
22
- Scenario: omitting hook
23
- Given this step works
24
- """
25
-
26
- Scenario: omit tagged hook
27
- When I run cucumber features/f.feature:2
28
- Then it should fail with
29
- """
30
- Feature: With and without hooks
31
-
32
- Scenario: using hook # features/f.feature:2
33
- boom (RuntimeError)
34
- ./features/support/hooks.rb:2:in `Before'
35
- Given this step works # features/step_definitions/steps.rb:1
36
-
37
- Failing Scenarios:
38
- cucumber features/f.feature:2 # Scenario: using hook
39
-
40
- 1 scenario (1 failed)
41
- 1 step (1 skipped)
42
-
43
- """
44
-
45
- Scenario: omit tagged hook
46
- When I run cucumber features/f.feature:6
47
- Then it should pass with
48
- """
49
- Feature: With and without hooks
50
-
51
- @no-boom
52
- Scenario: omitting hook # features/f.feature:6
53
- Given this step works # features/step_definitions/steps.rb:1
54
-
55
- 1 scenario (1 passed)
56
- 1 step (1 passed)
57
-
58
- """
59
-
60
-
@@ -1,37 +0,0 @@
1
- Feature: Post Configuration Hook [#423]
2
-
3
- In order to extend Cucumber
4
- As a developer
5
- I want to manipulate the Cucumber configuration after it has been created
6
-
7
- Scenario: configuration modified to use HTML formatter
8
-
9
- Given a standard Cucumber project directory structure
10
- And a file named "features/support/env.rb" with:
11
- """
12
- AfterConfiguration do |config|
13
- config.options[:formats] << ['html', config.out_stream]
14
- end
15
- """
16
- When I run cucumber features
17
- Then STDERR should be empty
18
- And the output should contain
19
- """
20
- html
21
- """
22
-
23
- Scenario: feature directories read from configuration
24
-
25
- Given a standard Cucumber project directory structure
26
- And a file named "features/support/env.rb" with:
27
- """
28
- AfterConfiguration do |config|
29
- config.out_stream << "AfterConfiguration hook read feature directories: #{config.feature_dirs.join(', ')}"
30
- end
31
- """
32
- When I run cucumber features
33
- Then STDERR should be empty
34
- And the output should contain
35
- """
36
- AfterConfiguration hook read feature directories: features
37
- """
@@ -1,126 +0,0 @@
1
- Feature: Profiles
2
- In order to save time and prevent carpal tunnel syndrome
3
- Cucumber users can save and reuse commonly used cucumber flags in a 'cucumber.yml' file.
4
- These named arguments are called profiles and the yml file should be in the root of your project.
5
- Any cucumber argument is valid in a profile. To see all the available flags type 'cucumber --help'
6
- For more information about profiles please see the wiki:
7
- http://wiki.github.com/aslakhellesoy/cucumber/cucumberyml
8
-
9
- Background: Basic App
10
- Given a standard Cucumber project directory structure
11
- And a file named "features/sample.feature" with:
12
- """
13
- Feature: Sample
14
- Scenario: this is a test
15
- Given I am just testing stuff
16
- """
17
- And a file named "features/support/env.rb"
18
- And a file named "features/support/super_env.rb"
19
- And the following profiles are defined:
20
- """
21
- default: features/sample.feature --require features/support/env.rb -v
22
- super: features/sample.feature --require features/support/super_env.rb -v
23
- """
24
-
25
- Scenario: Explicitly defining a profile to run
26
- When I run cucumber features/sample.feature --profile super
27
- Then the output should contain
28
- """
29
- Using the super profile...
30
- """
31
- And exactly these files should be loaded: features/support/super_env.rb
32
-
33
- Scenario: Explicitly defining a profile defined in an ERB formatted file
34
- Given the following profiles are defined:
35
- """
36
- <% requires = "--require features/support/super_env.rb" %>
37
- super: <%= "features/sample.feature #{requires} -v" %>
38
- """
39
- When I run cucumber features/sample.feature --profile super
40
- Then the output should contain
41
- """
42
- Using the super profile...
43
- """
44
- And exactly these files should be loaded: features/support/super_env.rb
45
-
46
- Scenario: Defining multiple profiles to run
47
- When I run cucumber features/sample.feature --profile default --profile super
48
- Then the output should contain
49
- """
50
- Using the default and super profiles...
51
- """
52
- And exactly these files should be loaded: features/support/env.rb, features/support/super_env.rb
53
-
54
- Scenario: Arguments passed in but no profile specified
55
- When I run cucumber -v
56
- Then the default profile should be used
57
- And exactly these files should be loaded: features/support/env.rb
58
-
59
- Scenario: Trying to use a missing profile
60
- When I run cucumber -p foo
61
- Then STDERR should be
62
- """
63
- Could not find profile: 'foo'
64
-
65
- Defined profiles in cucumber.yml:
66
- * default
67
- * super
68
-
69
- """
70
-
71
- Scenario Outline: Disabling the default profile
72
- When I run cucumber -v features/ <Flag>
73
- Then the output should contain
74
- """
75
- Disabling profiles...
76
- """
77
- And exactly these files should be loaded: features/support/env.rb, features/support/super_env.rb
78
-
79
- Examples:
80
- | Flag |
81
- | -P |
82
- | --no-profile |
83
-
84
-
85
- Scenario: Overriding the profile's features to run
86
- Given a file named "features/another.feature" with:
87
- """
88
- Feature: Just this one should be ran
89
- """
90
- When I run cucumber -p default features/another.feature
91
- Then exactly these features should be ran: features/another.feature
92
-
93
- Scenario: Overriding the profile's formatter
94
- You will most likely want to define a formatter in your default formatter.
95
- However, you often want to run your features with a different formatter
96
- yet still use the other the other arguments in the profile. Cucumber will
97
- allow you to do this by giving precedence to the formatter specified on the
98
- command line and override the one in the profile.
99
-
100
- Given the following profiles are defined:
101
- """
102
- default: features/sample.feature --require features/support/env.rb -v --format profile
103
- """
104
- When I run cucumber features --format pretty
105
- And the output should contain
106
- """
107
- Feature: Sample
108
- """
109
-
110
- Scenario Outline: Showing profiles when listing failing scenarios
111
- Given a file named "features/step_definitions/steps.rb" with:
112
- """
113
- Given /^I am just testing stuff$/ do
114
- raise 'BANG'
115
- end
116
- """
117
- When I run cucumber -q -p super -p default -f <format> features/sample.feature --require features/step_definitions/steps.rb
118
- Then it should fail
119
- And the output should contain
120
- """
121
- cucumber -p super features/sample.feature:2 # Scenario: this is a test
122
- """
123
- Examples:
124
- | format |
125
- | pretty |
126
- | progress|