cucumber 0.9.4 → 0.10.0

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 (107) hide show
  1. data/Gemfile +1 -1
  2. data/History.txt +16 -0
  3. data/bin/cucumber +7 -1
  4. data/cucumber.gemspec +5 -4
  5. data/cucumber.yml +1 -1
  6. data/examples/sinatra/features/support/env.rb +1 -4
  7. data/features/background.feature +284 -95
  8. data/features/custom_formatter.feature +3 -73
  9. data/features/execute_with_tag_filter.feature +63 -0
  10. data/features/{negative_tagged_hooks.feature → hooks.feature} +5 -6
  11. data/features/json_formatter.feature +161 -245
  12. data/features/stats_formatters.feature +70 -0
  13. data/features/step_definitions/cucumber_steps.rb +5 -163
  14. data/features/support/env.rb +23 -149
  15. data/features/{tag_logic.feature → tagged_hooks.feature} +11 -52
  16. data/gem_tasks/{features.rake → cucumber.rake} +6 -1
  17. data/{features → legacy_features}/announce.feature +0 -0
  18. data/{features → legacy_features}/api/list_step_defs_as_json.feature +0 -0
  19. data/{features → legacy_features}/api/run_cli_main_with_existing_runtime.feature +0 -0
  20. data/{features → legacy_features}/around_hooks.feature +0 -0
  21. data/{features → legacy_features}/bug_371.feature +0 -0
  22. data/{features → legacy_features}/bug_464.feature +0 -0
  23. data/{features → legacy_features}/bug_475.feature +0 -0
  24. data/{features → legacy_features}/bug_585_tab_indentation.feature +0 -0
  25. data/{features → legacy_features}/bug_600.feature +0 -0
  26. data/{features → legacy_features}/call_steps_from_stepdefs.feature +0 -0
  27. data/{features → legacy_features}/cucumber_cli.feature +9 -9
  28. data/{features → legacy_features}/cucumber_cli_outlines.feature +0 -0
  29. data/{features → legacy_features}/default_snippets.feature +0 -0
  30. data/{features → legacy_features}/diffing.feature +0 -0
  31. data/{features → legacy_features}/drb_server_integration.feature +0 -0
  32. data/{features → legacy_features}/exception_in_after_block.feature +0 -0
  33. data/{features → legacy_features}/exception_in_after_step_block.feature +0 -0
  34. data/{features → legacy_features}/exception_in_before_block.feature +0 -0
  35. data/{features → legacy_features}/exclude_files.feature +0 -0
  36. data/{features → legacy_features}/expand.feature +0 -0
  37. data/{features → legacy_features}/html_formatter.feature +0 -0
  38. data/{features → legacy_features}/html_formatter/a.html +0 -0
  39. data/{features → legacy_features}/junit_formatter.feature +0 -0
  40. data/{features → legacy_features}/language_from_header.feature +0 -0
  41. data/{features → legacy_features}/language_help.feature +0 -0
  42. data/{features → legacy_features}/listener_debugger_formatter.feature +0 -0
  43. data/legacy_features/multiline_names.feature +44 -0
  44. data/{features → legacy_features}/post_configuration_hook.feature +0 -0
  45. data/{features → legacy_features}/profiles.feature +0 -0
  46. data/{features → legacy_features}/rake_task.feature +0 -0
  47. data/{features → legacy_features}/report_called_undefined_steps.feature +0 -0
  48. data/{features → legacy_features}/rerun_formatter.feature +0 -0
  49. data/{features → legacy_features}/simplest.feature +0 -0
  50. data/{features → legacy_features}/snippet.feature +0 -0
  51. data/{features → legacy_features}/snippets_when_using_star_keyword.feature +0 -0
  52. data/legacy_features/step_definitions/cucumber_steps.rb +168 -0
  53. data/{features → legacy_features}/step_definitions/extra_steps.rb +0 -0
  54. data/{features → legacy_features}/step_definitions/simplest_steps.rb +0 -0
  55. data/{features → legacy_features}/step_definitions/wire_steps.rb +1 -0
  56. data/legacy_features/support/env.rb +157 -0
  57. data/{features → legacy_features}/support/env.rb.simplest +0 -0
  58. data/{features → legacy_features}/support/fake_wire_server.rb +0 -0
  59. data/{features → legacy_features}/table_diffing.feature +0 -0
  60. data/{features → legacy_features}/table_mapping.feature +0 -0
  61. data/{features → legacy_features}/transform.feature +0 -0
  62. data/{features → legacy_features}/unicode_table.feature +0 -0
  63. data/{features → legacy_features}/wire_protocol.feature +1 -1
  64. data/{features → legacy_features}/wire_protocol_table_diffing.feature +0 -0
  65. data/{features → legacy_features}/wire_protocol_tags.feature +0 -0
  66. data/{features → legacy_features}/wire_protocol_timeouts.feature +0 -0
  67. data/{features → legacy_features}/work_in_progress.feature +0 -0
  68. data/lib/cucumber/ast/examples.rb +5 -0
  69. data/lib/cucumber/ast/feature.rb +5 -0
  70. data/lib/cucumber/ast/feature_element.rb +5 -0
  71. data/lib/cucumber/ast/scenario_outline.rb +9 -4
  72. data/lib/cucumber/ast/step.rb +5 -0
  73. data/lib/cucumber/ast/step_invocation.rb +4 -0
  74. data/lib/cucumber/ast/table.rb +3 -3
  75. data/lib/cucumber/ast/tree_walker.rb +1 -39
  76. data/lib/cucumber/cli/main.rb +1 -6
  77. data/lib/cucumber/cli/options.rb +1 -2
  78. data/lib/cucumber/formatter/ansicolor.rb +2 -4
  79. data/lib/cucumber/formatter/gherkin_formatter_adapter.rb +84 -0
  80. data/lib/cucumber/formatter/gpretty.rb +24 -0
  81. data/lib/cucumber/formatter/html.rb +1 -1
  82. data/lib/cucumber/formatter/io.rb +2 -4
  83. data/lib/cucumber/formatter/json.rb +15 -152
  84. data/lib/cucumber/formatter/json_pretty.rb +5 -6
  85. data/lib/cucumber/formatter/unicode.rb +41 -20
  86. data/lib/cucumber/parser/gherkin_builder.rb +7 -1
  87. data/lib/cucumber/platform.rb +1 -1
  88. data/lib/cucumber/step_match.rb +5 -1
  89. data/spec/cucumber/ast/scenario_outline_spec.rb +11 -8
  90. data/spec/cucumber/ast/table_spec.rb +6 -1
  91. data/spec/cucumber/cli/main_spec.rb +4 -1
  92. metadata +105 -132
  93. data/features/multiline_names.feature +0 -44
  94. data/features/usage_and_stepdefs_formatter.feature +0 -169
  95. data/fixtures/json/features/pystring.feature +0 -8
  96. data/fixtures/self_test/features/background/background_tagged_before_on_outline.feature +0 -12
  97. data/fixtures/self_test/features/background/background_with_name.feature +0 -7
  98. data/fixtures/self_test/features/background/failing_background.feature +0 -12
  99. data/fixtures/self_test/features/background/failing_background_after_success.feature +0 -11
  100. data/fixtures/self_test/features/background/multiline_args_background.feature +0 -32
  101. data/fixtures/self_test/features/background/passing_background.feature +0 -10
  102. data/fixtures/self_test/features/background/pending_background.feature +0 -10
  103. data/fixtures/self_test/features/background/scenario_outline_failing_background.feature +0 -16
  104. data/fixtures/self_test/features/background/scenario_outline_passing_background.feature +0 -16
  105. data/lib/cucumber/formatter/color_io.rb +0 -23
  106. data/lib/cucumber/formatter/tag_cloud.rb +0 -35
  107. data/spec/cucumber/formatter/color_io_spec.rb +0 -29
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  group :development do
4
- gem 'bundler', '~> 1.0.3'
4
+ gem 'bundler', '~> 1.0.7'
5
5
  end
6
6
 
7
7
  gemspec
@@ -1,3 +1,19 @@
1
+ == 0.10.0 (2010-12-07)
2
+
3
+ We're bumping the minor number in this release because there are some incompatible changes in the JSON support.
4
+ This should not affect users. The major new feature in this release is ANSICON support for Windows users.
5
+
6
+ === New Features
7
+ * #map_column! should allow a string or symbol as the column name passed in (Ed Schmalzle)
8
+ * Deprecate win32console and use ANSICON instead (Boško Ivanišević)
9
+ * Set builder dependency to >= 2.1.2, which will work with both Rails 2 and 3. (bUg., David Trasbo, Matt Wynne)
10
+
11
+ === Bugfixes
12
+ * Changed the HTML formatter to show Scenarios with 'Pending' steps to be yellow rather than green (Arti)
13
+
14
+ === Changed Features
15
+ * JSON output now contains optional "match", "result" and "embeddings" elements underneath each step. (Aslak Hellesøy)
16
+
1
17
  == 0.9.4 (2010-11-07)
2
18
 
3
19
  === Bugfixes
@@ -1,12 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
2
  $:.unshift(File.dirname(__FILE__) + '/../lib') unless $:.include?(File.dirname(__FILE__) + '/../lib')
3
3
 
4
+ if(ENV['SIMPLECOV'])
5
+ require 'simplecov'
6
+ SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/..'))
7
+ SimpleCov.start
8
+ end
9
+
4
10
  require 'cucumber/rspec/disable_option_parser'
5
11
  require 'cucumber/cli/main'
6
12
  begin
7
13
  # The dup is to keep ARGV intact, so that tools like ruby-debug can respawn.
8
14
  failure = Cucumber::Cli::Main.execute(ARGV.dup)
9
- Kernel.exit(failure ? 1 : 0)
15
+ Kernel.exit(1) if failure
10
16
  rescue SystemExit => e
11
17
  Kernel.exit(e.status)
12
18
  rescue Exception => e
@@ -24,20 +24,21 @@ for important information about this release. Happy cuking!
24
24
 
25
25
  }
26
26
 
27
- s.add_dependency 'gherkin', '~> 2.2.9'
27
+ s.add_dependency 'gherkin', '~> 2.3.2'
28
28
  s.add_dependency 'term-ansicolor', '~> 1.0.5'
29
- s.add_dependency 'builder', '~> 2.1.2'
29
+ s.add_dependency 'builder', '>= 2.1.2'
30
30
  s.add_dependency 'diff-lcs', '~> 1.1.2'
31
31
  s.add_dependency 'json', '~> 1.4.6'
32
32
 
33
33
  s.add_development_dependency 'rake', '~> 0.8.7'
34
- s.add_development_dependency 'rspec', '~> 2.0.1'
34
+ s.add_development_dependency 'rspec', '~> 2.2.0'
35
35
  s.add_development_dependency 'nokogiri', '~> 1.4.3'
36
36
  s.add_development_dependency 'prawn', '= 0.8.4'
37
37
  s.add_development_dependency 'prawn-layout', '= 0.8.4'
38
38
  s.add_development_dependency 'syntax', '~> 1.0.0'
39
39
  s.add_development_dependency 'spork', '~> 0.8.4'
40
- # s.add_development_dependency 'rcov', '~> 0.9.9'
40
+ s.add_development_dependency 'aruba', '~> 0.2.7'
41
+ s.add_development_dependency 'simplecov', '~> 0.3.7'
41
42
 
42
43
  s.rubygems_version = "1.3.7"
43
44
  s.files = `git ls-files`.split("\n")
@@ -1,7 +1,7 @@
1
1
  <%
2
2
  rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
3
  rerun_opts = rerun.to_s.strip.empty? ? "--format progress features" : "--format pretty #{rerun}"
4
- std_opts = "--format progress features --strict --tags ~@wip"
4
+ std_opts = "--format pretty features --strict --tags ~@wip"
5
5
  begin
6
6
  require 'rspec/expectations'
7
7
  std_opts << ' --tags ~@rspec1'
@@ -1,10 +1,7 @@
1
1
  # See http://wiki.github.com/aslakhellesoy/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'
@@ -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