cucumber 0.8.5 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -15,7 +15,7 @@ Given "كتابة $n في الآلة الحاسبة" do |n|
15
15
  @calc.push n.to_i
16
16
  end
17
17
 
18
- When /يتم الضغط على (\w+)/ do |op|
18
+ When /يتم الضغط على (.+)/ do |op|
19
19
  @result = @calc.send op
20
20
  end
21
21
 
@@ -15,7 +15,7 @@ Given /שהזנתי (\d+) למחשבון/ do |n|
15
15
  @calc.push n.to_i
16
16
  end
17
17
 
18
- When /אני לוחץ על (\w+)/ do |op|
18
+ When /אני לוחץ על (.+)/ do |op|
19
19
  @result = @calc.send op
20
20
  end
21
21
 
@@ -4,21 +4,18 @@ require 'cucumber/formatter/unicode'
4
4
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
5
5
  require 'calculator'
6
6
 
7
- Before do
7
+ Datfiind /un calculator/ do
8
8
  @calc = Calculator.new
9
9
  end
10
10
 
11
- After do
12
- end
13
-
14
- Given /introduc (\d+)/ do |n|
11
+ Cand /introduc (\d+)/ do |n|
15
12
  @calc.push n.to_i
16
13
  end
17
14
 
18
- When 'apas suma' do
15
+ Cand 'apăs tasta Egal' do
19
16
  @result = @calc.add
20
17
  end
21
18
 
22
- Then /rezultatul trebuie sa fie (\d*)/ do |result|
19
+ Atunci /ecranul trebuie afişeze (\d*)/ do |result|
23
20
  @result.should == result.to_i
24
21
  end
@@ -1,5 +1,5 @@
1
1
  # language: ru
2
- Фича: Деление чисел
2
+ Функция: Деление чисел
3
3
  Поскольку деление сложный процесс и люди часто допускают ошибки
4
4
  Нужно дать им возможность делить на калькуляторе
5
5
 
@@ -9,7 +9,7 @@
9
9
  Если я нажимаю "/"
10
10
  То результатом должно быть число <частное>
11
11
 
12
- Значения:
12
+ Примеры:
13
13
  | делимое | делитель | частное |
14
14
  | 100 | 2 | 50 |
15
15
  | 28 | 7 | 4 |
@@ -11,14 +11,14 @@ end
11
11
  After do
12
12
  end
13
13
 
14
- Given /hesap makinesine (\d+) girdim/ do |n|
14
+ Diyelimki /hesap makinesine (\d+) girdim/ do |n|
15
15
  @calc.push n.to_i
16
16
  end
17
17
 
18
- When /(\w+) tuşuna basarsam/ do |op|
18
+ Eğerki /(.*) tuşuna basarsam/ do |op|
19
19
  @result = @calc.send op
20
20
  end
21
21
 
22
- Then /ekrandaki sonuç (.*) olmalı/ do |result|
22
+ Ozaman /ekrandaki sonuç (.*) olmalı/ do |result|
23
23
  @result.should == result.to_f
24
24
  end
@@ -1,10 +1,7 @@
1
- # See http://wiki.github.com/aslakhellesoy/cucumber/sinatra
1
+ # See http://wiki.github.com/cucumber/cucumber/sinatra
2
2
  # for more details about Sinatra with Cucumber
3
3
 
4
- app_file = File.join(File.dirname(__FILE__), *%w[.. .. app.rb])
5
- require app_file
6
- # Force the application name because polyglot breaks the auto-detection logic.
7
- Sinatra::Application.app_file = app_file
4
+ require File.dirname(__FILE__) + '/../../app'
8
5
 
9
6
  begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
10
7
  require 'rack/test'
@@ -17,7 +17,7 @@ Feature: Fibonacci
17
17
  | 9 | [1, 1, 2, 3, 5, 8] |
18
18
  | 100 | [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] |
19
19
 
20
- Scenario: Single series tested via a PyString
20
+ Scenario: Single series tested via a DocString
21
21
  When I ask Javascript to calculate fibonacci up to 2 with formatting
22
22
  Then it should give me:
23
23
  """
@@ -16,7 +16,7 @@ end
16
16
 
17
17
  # To avoid step definitions that are tightly coupled to your user interface,
18
18
  # consider creating classes for your pages - such as this:
19
- # http://github.com/aslakhellesoy/cucumber/tree/v0.1.15/examples/watir/features/step_definitons/search_steps.rb
19
+ # http://github.com/cucumber/cucumber/tree/v0.1.15/examples/watir/features/step_definitons/search_steps.rb
20
20
  #
21
21
  # You may keep the page classes along your steps, or even better, put them in separate files, e.g.
22
22
  # support/pages/google_search.rb
@@ -1,12 +1,195 @@
1
- Feature: backgrounds
1
+ Feature: Background
2
2
  In order to provide a context to my scenarios within a feature
3
3
  As a feature editor
4
4
  I want to write a background section in my features.
5
5
 
6
+ Background:
7
+ Given a file named "features/passing_background.feature" with:
8
+ """
9
+ Feature: Passing background sample
10
+
11
+ Background:
12
+ Given '10' cukes
13
+
14
+ Scenario: passing background
15
+ Then I should have '10' cukes
16
+
17
+ Scenario: another passing background
18
+ Then I should have '10' cukes
19
+ """
20
+ And a file named "features/scenario_outline_passing_background.feature" with:
21
+ """
22
+ Feature: Passing background with scenario outlines sample
23
+
24
+ Background:
25
+ Given '10' cukes
26
+
27
+ Scenario Outline: passing background
28
+ Then I should have '<count>' cukes
29
+ Examples:
30
+ |count|
31
+ | 10 |
32
+
33
+ Scenario Outline: another passing background
34
+ Then I should have '<count>' cukes
35
+ Examples:
36
+ |count|
37
+ | 10 |
38
+ """
39
+ And a file named "features/background_tagged_before_on_outline.feature" with:
40
+ """
41
+ @background_tagged_before_on_outline
42
+ Feature: Background tagged Before on Outline
43
+
44
+ Background:
45
+ Given passing without a table
46
+
47
+ Scenario Outline: passing background
48
+ Then I should have '<count>' cukes
49
+
50
+ Examples:
51
+ | count |
52
+ | 888 |
53
+ """
54
+ And a file named "features/failing_background.feature" with:
55
+ """
56
+ Feature: Failing background sample
57
+
58
+ Background:
59
+ Given failing without a table
60
+ And '10' cukes
61
+
62
+ Scenario: failing background
63
+ Then I should have '10' cukes
64
+
65
+ Scenario: another failing background
66
+ Then I should have '10' cukes
67
+ """
68
+ And a file named "features/scenario_outline_failing_background.feature" with:
69
+ """
70
+ Feature: Failing background with scenario outlines sample
71
+
72
+ Background:
73
+ Given failing without a table
74
+
75
+ Scenario Outline: failing background
76
+ Then I should have '<count>' cukes
77
+ Examples:
78
+ |count|
79
+ | 10 |
80
+
81
+ Scenario Outline: another failing background
82
+ Then I should have '<count>' cukes
83
+ Examples:
84
+ |count|
85
+ | 10 |
86
+ """
87
+ And a file named "features/pending_background.feature" with:
88
+ """
89
+ Feature: Pending background sample
90
+
91
+ Background:
92
+ Given pending
93
+
94
+ Scenario: pending background
95
+ Then I should have '10' cukes
96
+
97
+ Scenario: another pending background
98
+ Then I should have '10' cukes
99
+ """
100
+ And a file named "features/failing_background_after_success.feature" with:
101
+ """
102
+ Feature: Failing background after previously successful background sample
103
+
104
+ Background:
105
+ Given passing without a table
106
+ And '10' global cukes
107
+
108
+ Scenario: passing background
109
+ Then I should have '10' global cukes
110
+
111
+ Scenario: failing background
112
+ Then I should have '10' global cukes
113
+ """
114
+ And a file named "features/multiline_args_background.feature" with:
115
+ """
116
+ Feature: Passing background with multiline args
117
+
118
+ Background:
119
+ Given table
120
+ |a|b|
121
+ |c|d|
122
+ And multiline string
123
+ \"\"\"
124
+ I'm a cucumber and I'm okay.
125
+ I sleep all night and I test all day
126
+ \"\"\"
127
+
128
+ Scenario: passing background
129
+ Then the table should be
130
+ |a|b|
131
+ |c|d|
132
+ Then the multiline string should be
133
+ \"\"\"
134
+ I'm a cucumber and I'm okay.
135
+ I sleep all night and I test all day
136
+ \"\"\"
137
+
138
+ Scenario: another passing background
139
+ Then the table should be
140
+ |a|b|
141
+ |c|d|
142
+ Then the multiline string should be
143
+ \"\"\"
144
+ I'm a cucumber and I'm okay.
145
+ I sleep all night and I test all day
146
+ \"\"\"
147
+ """
148
+ And a file named "features/step_definitions/steps.rb" with:
149
+ """
150
+ def flunker
151
+ raise "FAIL"
152
+ end
153
+
154
+ Given /^'(.+)' cukes$/ do |cukes| x=1
155
+ raise "We already have #{@cukes} cukes!" if @cukes
156
+ @cukes = cukes
157
+ end
158
+
159
+ Given(/^passing without a table$/) do
160
+ end
161
+
162
+ Given /^failing without a table$/ do x=1
163
+ flunker
164
+ end
165
+
166
+ Given /^'(.+)' global cukes$/ do |cukes| x=1
167
+ $scenario_runs ||= 0
168
+ flunker if $scenario_runs >= 1
169
+ $cukes = cukes
170
+ $scenario_runs += 1
171
+ end
172
+
173
+ Then /^I should have '(.+)' global cukes$/ do |cukes| x=1
174
+ $cukes.should == cukes
175
+ end
176
+
177
+ Then /^I should have '(.+)' cukes$/ do |cukes| x=1
178
+ @cukes.should == cukes
179
+ end
180
+
181
+ Before('@background_tagged_before_on_outline') do
182
+ @cukes = '888'
183
+ end
184
+
185
+ After('@background_tagged_before_on_outline') do
186
+ @cukes.should == '888'
187
+ end
188
+ """
189
+
6
190
  Scenario: run a specific scenario with a background
7
- When I run cucumber -q features/background/passing_background.feature:9 --require features
8
- Then STDERR should be empty
9
- Then it should pass with
191
+ When I run `cucumber -q features/passing_background.feature:9`
192
+ Then it should pass with exactly:
10
193
  """
11
194
  Feature: Passing background sample
12
195
 
@@ -18,12 +201,13 @@ Feature: backgrounds
18
201
 
19
202
  1 scenario (1 passed)
20
203
  2 steps (2 passed)
21
-
204
+ 0m0.012s
205
+
22
206
  """
23
207
 
24
208
  Scenario: run a feature with a background that passes
25
- When I run cucumber -q features/background/passing_background.feature --require features
26
- Then it should pass with
209
+ When I run `cucumber -q features/passing_background.feature`
210
+ Then it should pass with exactly:
27
211
  """
28
212
  Feature: Passing background sample
29
213
 
@@ -38,12 +222,13 @@ Feature: backgrounds
38
222
 
39
223
  2 scenarios (2 passed)
40
224
  4 steps (4 passed)
41
-
225
+ 0m0.012s
226
+
42
227
  """
43
228
 
44
229
  Scenario: run a feature with scenario outlines that has a background that passes
45
- When I run cucumber -q features/background/scenario_outline_passing_background.feature --require features
46
- Then it should pass with
230
+ When I run `cucumber -q features/scenario_outline_passing_background.feature`
231
+ Then it should pass with exactly:
47
232
  """
48
233
  Feature: Passing background with scenario outlines sample
49
234
 
@@ -66,12 +251,13 @@ Feature: backgrounds
66
251
 
67
252
  2 scenarios (2 passed)
68
253
  4 steps (4 passed)
254
+ 0m0.012s
69
255
 
70
256
  """
71
257
 
72
258
  Scenario: run a feature with scenario outlines that has a background that passes
73
- When I run cucumber -q features/background/background_tagged_before_on_outline.feature --require features
74
- Then it should pass with
259
+ When I run `cucumber -q features/background_tagged_before_on_outline.feature`
260
+ Then it should pass with exactly:
75
261
  """
76
262
  @background_tagged_before_on_outline
77
263
  Feature: Background tagged Before on Outline
@@ -88,22 +274,22 @@ Feature: backgrounds
88
274
 
89
275
  1 scenario (1 passed)
90
276
  2 steps (2 passed)
277
+ 0m0.012s
91
278
 
92
279
  """
93
280
 
94
281
  Scenario: run a feature with a background that fails
95
- When I run cucumber -q features/background/failing_background.feature --require features
96
- Then it should fail with
282
+ When I run `cucumber -q features/failing_background.feature`
283
+ Then it should fail with exactly:
97
284
  """
98
- @after_file
99
285
  Feature: Failing background sample
100
286
 
101
287
  Background:
102
288
  Given failing without a table
103
289
  FAIL (RuntimeError)
104
- ./features/step_definitions/sample_steps.rb:2:in `flunker'
105
- ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
106
- features/background/failing_background.feature:5:in `Given failing without a table'
290
+ ./features/step_definitions/steps.rb:2:in `flunker'
291
+ ./features/step_definitions/steps.rb:14:in `/^failing without a table$/'
292
+ features/failing_background.feature:4:in `Given failing without a table'
107
293
  And '10' cukes
108
294
 
109
295
  Scenario: failing background
@@ -113,26 +299,26 @@ Feature: backgrounds
113
299
  Then I should have '10' cukes
114
300
 
115
301
  Failing Scenarios:
116
- cucumber features/background/failing_background.feature:8 # Scenario: failing background
302
+ cucumber features/failing_background.feature:7 # Scenario: failing background
117
303
 
118
304
  2 scenarios (1 failed, 1 skipped)
119
305
  6 steps (1 failed, 5 skipped)
120
-
306
+ 0m0.012s
307
+
121
308
  """
122
- And "fixtures/self_test/tmp/after.txt" should exist
123
309
 
124
310
  Scenario: run a feature with scenario outlines that has a background that fails
125
- When I run cucumber -q features/background/scenario_outline_failing_background.feature --require features
126
- Then it should fail with
311
+ When I run `cucumber -q features/scenario_outline_failing_background.feature`
312
+ Then it should fail with exactly:
127
313
  """
128
314
  Feature: Failing background with scenario outlines sample
129
315
 
130
316
  Background:
131
317
  Given failing without a table
132
318
  FAIL (RuntimeError)
133
- ./features/step_definitions/sample_steps.rb:2:in `flunker'
134
- ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
135
- features/background/scenario_outline_failing_background.feature:4:in `Given failing without a table'
319
+ ./features/step_definitions/steps.rb:2:in `flunker'
320
+ ./features/step_definitions/steps.rb:14:in `/^failing without a table$/'
321
+ features/scenario_outline_failing_background.feature:4:in `Given failing without a table'
136
322
 
137
323
  Scenario Outline: failing background
138
324
  Then I should have '<count>' cukes
@@ -149,16 +335,17 @@ Feature: backgrounds
149
335
  | 10 |
150
336
 
151
337
  Failing Scenarios:
152
- cucumber features/background/scenario_outline_failing_background.feature:6 # Scenario: failing background
338
+ cucumber features/scenario_outline_failing_background.feature:6 # Scenario: failing background
153
339
 
154
340
  2 scenarios (1 failed, 1 skipped)
155
341
  4 steps (1 failed, 3 skipped)
156
-
342
+ 0m0.012s
343
+
157
344
  """
158
345
 
159
346
  Scenario: run a feature with a background that is pending
160
- When I run cucumber -q features/background/pending_background.feature --require features
161
- Then it should pass with
347
+ When I run `cucumber -q features/pending_background.feature`
348
+ Then it should pass with exactly:
162
349
  """
163
350
  Feature: Pending background sample
164
351
 
@@ -173,12 +360,13 @@ Feature: backgrounds
173
360
 
174
361
  2 scenarios (2 undefined)
175
362
  4 steps (2 skipped, 2 undefined)
176
-
363
+ 0m0.012s
364
+
177
365
  """
178
366
 
179
367
  Scenario: background passes with first scenario but fails with second
180
- When I run cucumber -q features/background/failing_background_after_success.feature --require features
181
- Then it should fail with
368
+ When I run `cucumber -q features/failing_background_after_success.feature`
369
+ Then it should fail with exactly:
182
370
  """
183
371
  Feature: Failing background after previously successful background sample
184
372
 
@@ -192,84 +380,86 @@ Feature: backgrounds
192
380
  Scenario: failing background
193
381
  And '10' global cukes
194
382
  FAIL (RuntimeError)
195
- ./features/step_definitions/sample_steps.rb:2:in `flunker'
196
- ./features/step_definitions/sample_steps.rb:37:in `/^'(.+)' global cukes$/'
197
- features/background/failing_background_after_success.feature:5:in `And '10' global cukes'
383
+ ./features/step_definitions/steps.rb:2:in `flunker'
384
+ ./features/step_definitions/steps.rb:19:in `/^'(.+)' global cukes$/'
385
+ features/failing_background_after_success.feature:5:in `And '10' global cukes'
198
386
  Then I should have '10' global cukes
199
387
 
200
388
  Failing Scenarios:
201
- cucumber features/background/failing_background_after_success.feature:10 # Scenario: failing background
389
+ cucumber features/failing_background_after_success.feature:10 # Scenario: failing background
202
390
 
203
391
  2 scenarios (1 failed, 1 passed)
204
392
  6 steps (1 failed, 1 skipped, 4 passed)
205
-
393
+ 0m0.012s
394
+
206
395
  """
207
396
 
208
397
  Scenario: background with multline args
209
- When I run cucumber -q features/background/multiline_args_background.feature --require features
210
- Then it should pass with
211
- """
212
- Feature: Passing background with multiline args
398
+ Given a file named "features/step_definitions/multiline_steps.rb" with:
399
+ """
400
+ Given /^table$/ do |table| x=1
401
+ @table = table
402
+ end
213
403
 
214
- Background:
215
- Given table
216
- | a | b |
217
- | c | d |
218
- And multiline string
219
- \"\"\"
404
+ Given /^multiline string$/ do |string| x=1
405
+ @multiline = string
406
+ end
407
+
408
+ Then /^the table should be$/ do |table| x=1
409
+ @table.raw.should == table.raw
410
+ end
411
+
412
+ Then /^the multiline string should be$/ do |string| x=1
413
+ @multiline.should == string
414
+ end
415
+ """
416
+ When I run `cucumber -q features/multiline_args_background.feature`
417
+ Then it should pass with exactly:
418
+ """
419
+ Feature: Passing background with multiline args
420
+
421
+ Background:
422
+ Given table
423
+ | a | b |
424
+ | c | d |
425
+ And multiline string
426
+ \"\"\"
220
427
  I'm a cucumber and I'm okay.
221
428
  I sleep all night and I test all day
222
- \"\"\"
223
-
224
- Scenario: passing background
225
- Then the table should be
226
- | a | b |
227
- | c | d |
228
- Then the multiline string should be
229
- \"\"\"
429
+ \"\"\"
430
+
431
+ Scenario: passing background
432
+ Then the table should be
433
+ | a | b |
434
+ | c | d |
435
+ Then the multiline string should be
436
+ \"\"\"
230
437
  I'm a cucumber and I'm okay.
231
438
  I sleep all night and I test all day
232
- \"\"\"
233
-
234
- Scenario: another passing background
235
- Then the table should be
236
- | a | b |
237
- | c | d |
238
- Then the multiline string should be
239
- \"\"\"
439
+ \"\"\"
440
+
441
+ Scenario: another passing background
442
+ Then the table should be
443
+ | a | b |
444
+ | c | d |
445
+ Then the multiline string should be
446
+ \"\"\"
240
447
  I'm a cucumber and I'm okay.
241
448
  I sleep all night and I test all day
242
- \"\"\"
449
+ \"\"\"
243
450
 
244
- 2 scenarios (2 passed)
245
- 8 steps (8 passed)
451
+ 2 scenarios (2 passed)
452
+ 8 steps (8 passed)
453
+ 0m0.012s
246
454
 
247
- """
248
-
249
- Scenario: background with name
250
- When I run cucumber -q features/background/background_with_name.feature --require features
251
- Then it should pass with
252
- """
253
- Feature: background with name
254
-
255
- Background: I'm a background and I'm ok
256
- Given '10' cukes
257
-
258
- Scenario: example
259
- Then I should have '10' cukes
260
-
261
- 1 scenario (1 passed)
262
- 2 steps (2 passed)
263
-
264
- """
455
+ """
265
456
 
266
457
  Scenario: https://rspec.lighthouseapp.com/projects/16211/tickets/329
267
- Given a standard Cucumber project directory structure
268
- And a file named "features/only_background_and_hooks.feature" with:
458
+ Given a file named "features/only_background_and_hooks.feature" with:
269
459
  """
270
460
  Feature: woo yeah
271
461
 
272
- Background:
462
+ Background: Whatever
273
463
  Given whatever
274
464
 
275
465
  """
@@ -293,17 +483,16 @@ Feature: backgrounds
293
483
  $after.should == true
294
484
  end
295
485
  """
296
- When I run cucumber features/only_background_and_hooks.feature
297
- Then it should pass
298
- And the output should be
486
+ When I run `cucumber features/only_background_and_hooks.feature`
487
+ Then it should pass with exactly:
299
488
  """
300
489
  Feature: woo yeah
301
490
 
302
- Background: # features/only_background_and_hooks.feature:3
303
- Given whatever # features/only_background_and_hooks_steps.rb:11
491
+ Background: Whatever # features/only_background_and_hooks.feature:3
492
+ Given whatever # features/only_background_and_hooks_steps.rb:11
304
493
 
305
494
  0 scenarios
306
495
  1 step (1 passed)
307
-
496
+ 0m0.012s
497
+
308
498
  """
309
- And STDERR should be empty