aslakhellesoy-cucumber 0.3.1 → 0.3.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,12 @@
1
+ == 0.3.2 (In Git)
2
+
3
+ === Bugfixes
4
+ * Step table with blank cell fails (#308 JohnnyT)
5
+
6
+ === New features
7
+ * Summary should report scenarios (#32 Aslak Hellesøy)
8
+ * Examples and the associated tables are indented one level deeper than Scenario Outline. (Aslak Hellesøy)
9
+
1
10
  == 0.3.1 2009-04-26
2
11
 
3
12
  This release has several minor bug fixes and new features. With the addition of Latvian and Hungarian Cucumber
@@ -0,0 +1,22 @@
1
+ Feature: search examples
2
+
3
+ Background: Hantu Pisang background match
4
+ Given passing without a table
5
+
6
+ Scenario: should match Hantu Pisang
7
+ Given passing without a table
8
+
9
+ Scenario: Ignore me
10
+ Given failing without a table
11
+
12
+ Scenario Outline: Ignore me
13
+ Given <state> without a table
14
+ Examples:
15
+ |state|
16
+ |failing|
17
+
18
+ Scenario Outline: Hantu Pisang match
19
+ Given <state> without a table
20
+ Examples:
21
+ |state|
22
+ |passing|
@@ -15,8 +15,8 @@ Feature: backgrounds
15
15
  Scenario: another passing background
16
16
  Then I should have '10' cukes
17
17
 
18
- 1 scenario
19
- 2 passed steps
18
+ 1 scenario (1 passed)
19
+ 2 steps (2 passed)
20
20
 
21
21
  """
22
22
 
@@ -35,8 +35,8 @@ Feature: backgrounds
35
35
  Scenario: another passing background
36
36
  Then I should have '10' cukes
37
37
 
38
- 2 scenarios
39
- 4 passed steps
38
+ 2 scenarios (2 passed)
39
+ 4 steps (4 passed)
40
40
 
41
41
  """
42
42
 
@@ -52,19 +52,19 @@ Feature: backgrounds
52
52
  Scenario Outline: passing background
53
53
  Then I should have '<count>' cukes
54
54
 
55
- Examples:
56
- | count |
57
- | 10 |
55
+ Examples:
56
+ | count |
57
+ | 10 |
58
58
 
59
59
  Scenario Outline: another passing background
60
60
  Then I should have '<count>' cukes
61
61
 
62
- Examples:
63
- | count |
64
- | 10 |
62
+ Examples:
63
+ | count |
64
+ | 10 |
65
65
 
66
- 2 scenarios
67
- 4 passed steps
66
+ 2 scenarios (2 passed)
67
+ 4 steps (4 passed)
68
68
 
69
69
  """
70
70
 
@@ -89,9 +89,8 @@ Feature: backgrounds
89
89
  Scenario: another failing background
90
90
  Then I should have '10' cukes
91
91
 
92
- 2 scenarios
93
- 1 failed step
94
- 5 skipped steps
92
+ 2 scenarios (1 failed, 1 skipped)
93
+ 6 steps (1 failed, 5 skipped)
95
94
 
96
95
  """
97
96
  And "examples/self_test/tmp/after.txt" should exist
@@ -112,20 +111,19 @@ Feature: backgrounds
112
111
  Scenario Outline: failing background
113
112
  Then I should have '<count>' cukes
114
113
 
115
- Examples:
116
- | count |
117
- | 10 |
114
+ Examples:
115
+ | count |
116
+ | 10 |
118
117
 
119
118
  Scenario Outline: another failing background
120
119
  Then I should have '<count>' cukes
121
120
 
122
- Examples:
123
- | count |
124
- | 10 |
121
+ Examples:
122
+ | count |
123
+ | 10 |
125
124
 
126
- 2 scenarios
127
- 1 failed step
128
- 3 skipped steps
125
+ 2 scenarios (1 failed, 1 skipped)
126
+ 4 steps (1 failed, 3 skipped)
129
127
 
130
128
  """
131
129
 
@@ -144,9 +142,8 @@ Feature: backgrounds
144
142
  Scenario: another pending background
145
143
  Then I should have '10' cukes
146
144
 
147
- 2 scenarios
148
- 2 skipped steps
149
- 2 undefined steps
145
+ 2 scenarios (2 undefined)
146
+ 4 steps (2 skipped, 2 undefined)
150
147
 
151
148
  """
152
149
 
@@ -171,10 +168,8 @@ Feature: backgrounds
171
168
  features/background/failing_background_after_success.feature:5:in `And '10' global cukes'
172
169
  Then I should have '10' global cukes
173
170
 
174
- 2 scenarios
175
- 1 failed step
176
- 1 skipped step
177
- 4 passed steps
171
+ 2 scenarios (1 failed, 1 passed)
172
+ 6 steps (1 failed, 1 skipped, 4 passed)
178
173
 
179
174
  """
180
175
 
@@ -214,8 +209,8 @@ Feature: backgrounds
214
209
  I sleep all night and I test all day
215
210
  \"\"\"
216
211
 
217
- 2 scenarios
218
- 8 passed steps
212
+ 2 scenarios (2 passed)
213
+ 8 steps (8 passed)
219
214
 
220
215
  """
221
216
 
@@ -231,8 +226,8 @@ Feature: backgrounds
231
226
  Scenario: example
232
227
  Then I should have '10' cukes
233
228
 
234
- 1 scenario
235
- 2 passed steps
229
+ 1 scenario (1 passed)
230
+ 2 steps (2 passed)
236
231
 
237
232
  """
238
233
 
@@ -13,8 +13,8 @@ Feature: Cucumber command line
13
13
  Scenario: Missing
14
14
  Given missing
15
15
 
16
- 1 scenario
17
- 1 undefined step
16
+ 1 scenario (1 undefined)
17
+ 1 step (1 undefined)
18
18
 
19
19
  """
20
20
 
@@ -31,8 +31,8 @@ Feature: Cucumber command line
31
31
  Undefined step: "missing" (Cucumber::Undefined)
32
32
  features/sample.feature:6:in `Given missing'
33
33
 
34
- 1 scenario
35
- 1 undefined step
34
+ 1 scenario (1 undefined)
35
+ 1 step (1 undefined)
36
36
 
37
37
  """
38
38
 
@@ -49,8 +49,8 @@ Feature: Cucumber command line
49
49
  | a | b |
50
50
  | c | d |
51
51
 
52
- 1 scenario
53
- 1 passed step
52
+ 1 scenario (1 passed)
53
+ 1 step (1 passed)
54
54
 
55
55
  """
56
56
 
@@ -76,9 +76,8 @@ Feature: Cucumber command line
76
76
  ./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
77
77
  features/sample.feature:16:in `Given failing'
78
78
 
79
- 2 scenarios
80
- 1 failed step
81
- 1 undefined step
79
+ 2 scenarios (1 failed, 1 undefined)
80
+ 2 steps (1 failed, 1 undefined)
82
81
 
83
82
  """
84
83
 
@@ -93,8 +92,8 @@ Feature: Cucumber command line
93
92
  Scenario: Missing
94
93
  Given missing
95
94
 
96
- 1 scenario
97
- 1 passed step
95
+ 1 scenario (1 passed)
96
+ 1 step (1 passed)
98
97
 
99
98
  """
100
99
 
@@ -111,8 +110,8 @@ Feature: Cucumber command line
111
110
  | a | b |
112
111
  | c | d |
113
112
 
114
- 1 scenario
115
- 1 passed step
113
+ 1 scenario (1 passed)
114
+ 1 step (1 passed)
116
115
 
117
116
  """
118
117
 
@@ -129,10 +128,8 @@ Feature: Cucumber command line
129
128
  ./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
130
129
  features/sample.feature:16:in `Given failing'
131
130
 
132
- 3 scenarios
133
- 1 failed step
134
- 1 undefined step
135
- 1 passed step
131
+ 3 scenarios (1 failed, 1 undefined, 1 passed)
132
+ 3 steps (1 failed, 1 undefined, 1 passed)
136
133
 
137
134
  """
138
135
 
@@ -160,8 +157,8 @@ Feature: Cucumber command line
160
157
  Når jeg summerer
161
158
  Så skal resultatet være 13
162
159
 
163
- 2 scenarios
164
- 9 passed steps
160
+ 2 scenarios (2 passed)
161
+ 9 steps (9 passed)
165
162
 
166
163
  """
167
164
 
@@ -208,18 +205,18 @@ Feature: Cucumber command line
208
205
  yawn
209
206
  Given <state> without a table
210
207
 
211
- Examples:
212
- | state |
213
- | passing |
208
+ Examples:
209
+ | state |
210
+ | passing |
214
211
 
215
212
  Scenario Outline: name
216
213
  Given <state> without a table
217
214
 
218
- Examples: I'm a multiline name
219
- which goes on and on and on for three lines
220
- yawn
221
- | state |
222
- | passing |
215
+ Examples: I'm a multiline name
216
+ which goes on and on and on for three lines
217
+ yawn
218
+ | state |
219
+ | passing |
223
220
 
224
221
  Feature: Outline Sample
225
222
 
@@ -229,15 +226,15 @@ Feature: Cucumber command line
229
226
  Given <state> without a table
230
227
  Given <other_state> without a table
231
228
 
232
- Examples: Rainbow colours
233
- | state | other_state |
234
- | missing | passing |
235
- | passing | passing |
236
- | failing | passing |
229
+ Examples: Rainbow colours
230
+ | state | other_state |
231
+ | missing | passing |
232
+ | passing | passing |
233
+ | failing | passing |
237
234
 
238
- Examples: Only passing
239
- | state | other_state |
240
- | passing | passing |
235
+ Examples: Only passing
236
+ | state | other_state |
237
+ | passing | passing |
241
238
 
242
239
  @one
243
240
  Feature: Sample
@@ -273,16 +270,16 @@ Feature: Cucumber command line
273
270
  Scenario Outline: Ignore me
274
271
  Given <state> without a table
275
272
 
276
- Examples:
277
- | state |
278
- | failing |
273
+ Examples:
274
+ | state |
275
+ | failing |
279
276
 
280
277
  Scenario Outline: Hantu Pisang match
281
278
  Given <state> without a table
282
279
 
283
- Examples:
284
- | state |
285
- | passing |
280
+ Examples:
281
+ | state |
282
+ | passing |
286
283
 
287
284
  Feature: undefined multiline args
288
285
 
@@ -297,9 +294,8 @@ Feature: Cucumber command line
297
294
  | table |
298
295
  | example |
299
296
 
300
- 21 scenarios
301
- 26 skipped steps
302
- 9 undefined steps
297
+ 21 scenarios (15 skipped, 5 undefined, 1 passed)
298
+ 35 steps (26 skipped, 9 undefined)
303
299
 
304
300
  """
305
301
 
@@ -309,11 +305,11 @@ Feature: Cucumber command line
309
305
  """
310
306
  UUUUU
311
307
 
312
- 1 scenario
313
- 5 undefined steps
308
+ 1 scenario (1 undefined)
309
+ 5 steps (5 undefined)
314
310
 
315
311
  """
316
- And "examples/self_test/tmp/pretty.txt" should match
312
+ And "examples/self_test/tmp/pretty.txt" should contain
317
313
  """
318
314
  Feature: Lots of undefined
319
315
 
@@ -323,9 +319,9 @@ Feature: Cucumber command line
323
319
  And it's 40 degrees in Norway
324
320
  When I stop procrastinating
325
321
  And there is world peace
326
-
327
- 1 scenario
328
- 5 undefined steps
322
+
323
+ 1 scenario (1 undefined)
324
+ 5 steps (5 undefined)
329
325
 
330
326
  """
331
327
 
@@ -344,12 +340,12 @@ Feature: Cucumber command line
344
340
  Scenario Outline: Hantu Pisang match
345
341
  Given <state> without a table
346
342
 
347
- Examples:
348
- | state |
349
- | passing |
343
+ Examples:
344
+ | state |
345
+ | passing |
350
346
 
351
- 2 scenarios
352
- 4 passed steps
347
+ 2 scenarios (2 passed)
348
+ 4 steps (4 passed)
353
349
 
354
350
  """
355
351
 
@@ -362,8 +358,8 @@ Feature: Cucumber command line
362
358
  Background: Hantu Pisang background match
363
359
  Given passing without a table
364
360
 
365
- 0 scenarios
366
- 1 passed step
361
+ 0 scenarios ()
362
+ 1 step (1 passed)
367
363
 
368
364
  """
369
365
 
@@ -385,9 +381,8 @@ Feature: Cucumber command line
385
381
  | a | b |
386
382
  | c | d |
387
383
 
388
- 2 scenarios
389
- 1 undefined step
390
- 1 passed step
384
+ 2 scenarios (1 undefined, 1 passed)
385
+ 2 steps (1 undefined, 1 passed)
391
386
 
392
387
  """
393
388
 
@@ -419,10 +414,8 @@ Feature: Cucumber command line
419
414
  ./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
420
415
  features/sample.feature:16:in `Given failing'
421
416
 
422
- 3 scenarios
423
- 1 failed step
424
- 1 undefined step
425
- 1 passed step
417
+ 3 scenarios (1 failed, 1 undefined, 1 passed)
418
+ 3 steps (1 failed, 1 undefined, 1 passed)
426
419
 
427
420
  """
428
421
 
@@ -443,9 +436,8 @@ Feature: Cucumber command line
443
436
  | a | b |
444
437
  | c | d |
445
438
 
446
- 2 scenarios
447
- 1 skipped step
448
- 1 undefined step
439
+ 2 scenarios (1 skipped, 1 undefined)
440
+ 2 steps (1 skipped, 1 undefined)
449
441
 
450
442
  """
451
443
 
@@ -20,8 +20,8 @@ Feature: Cucumber command line
20
20
  ./features/step_definitions/sample_steps.rb:63:in `/^failing expectation$/'
21
21
  features/failing_expectation.feature:4:in `Given failing expectation'
22
22
 
23
- 1 scenario
24
- 1 failed step
23
+ 1 scenario (1 failed)
24
+ 1 step (1 failed)
25
25
 
26
26
  """
27
27
 
@@ -38,8 +38,8 @@ Feature: Cucumber command line
38
38
  ./features/step_definitions/sample_steps.rb:63:in `/^failing expectation$/'
39
39
  features/failing_expectation.feature:4:in `Given failing expectation'
40
40
 
41
- 1 scenario
42
- 1 failed step
41
+ 1 scenario (1 failed)
42
+ 1 step (1 failed)
43
43
 
44
44
  """
45
45
 
@@ -12,25 +12,22 @@ Feature: Cucumber command line
12
12
  Given <state> without a table
13
13
  Given <other_state> without a table
14
14
 
15
- Examples: Rainbow colours
16
- | state | other_state |
17
- | missing | passing |
18
- | passing | passing |
19
- | failing | passing |
20
- FAIL (RuntimeError)
21
- ./features/step_definitions/sample_steps.rb:2:in `flunker'
22
- ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
23
- features/outline_sample.feature:6:in `Given <state> without a table'
24
-
25
- Examples: Only passing
26
- | state | other_state |
27
- | passing | passing |
28
-
29
- 4 scenarios
30
- 1 failed step
31
- 2 skipped steps
32
- 1 undefined step
33
- 4 passed steps
15
+ Examples: Rainbow colours
16
+ | state | other_state |
17
+ | missing | passing |
18
+ | passing | passing |
19
+ | failing | passing |
20
+ FAIL (RuntimeError)
21
+ ./features/step_definitions/sample_steps.rb:2:in `flunker'
22
+ ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
23
+ features/outline_sample.feature:6:in `Given <state> without a table'
24
+
25
+ Examples: Only passing
26
+ | state | other_state |
27
+ | passing | passing |
28
+
29
+ 4 scenarios (1 failed, 1 undefined, 2 passed)
30
+ 8 steps (1 failed, 2 skipped, 1 undefined, 4 passed)
34
31
 
35
32
  """
36
33
 
@@ -44,25 +41,22 @@ Feature: Cucumber command line
44
41
  Given <state> without a table
45
42
  Given <other_state> without a table
46
43
 
47
- Examples: Rainbow colours
48
- | state | other_state |
49
- | missing | passing |
50
- | passing | passing |
51
- | failing | passing |
52
- FAIL (RuntimeError)
53
- ./features/step_definitions/sample_steps.rb:2:in `flunker'
54
- ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
55
- features/outline_sample.feature:6:in `Given <state> without a table'
56
-
57
- Examples: Only passing
58
- | state | other_state |
59
- | passing | passing |
60
-
61
- 4 scenarios
62
- 1 failed step
63
- 2 skipped steps
64
- 1 undefined step
65
- 4 passed steps
44
+ Examples: Rainbow colours
45
+ | state | other_state |
46
+ | missing | passing |
47
+ | passing | passing |
48
+ | failing | passing |
49
+ FAIL (RuntimeError)
50
+ ./features/step_definitions/sample_steps.rb:2:in `flunker'
51
+ ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
52
+ features/outline_sample.feature:6:in `Given <state> without a table'
53
+
54
+ Examples: Only passing
55
+ | state | other_state |
56
+ | passing | passing |
57
+
58
+ 4 scenarios (1 failed, 1 undefined, 2 passed)
59
+ 8 steps (1 failed, 2 skipped, 1 undefined, 4 passed)
66
60
 
67
61
  """
68
62
 
@@ -76,17 +70,16 @@ Feature: Cucumber command line
76
70
  Given <state> without a table # features/step_definitions/sample_steps.rb:15
77
71
  Given <other_state> without a table # features/step_definitions/sample_steps.rb:12
78
72
 
79
- Examples: Rainbow colours
80
- | state | other_state |
81
- | failing | passing |
82
- FAIL (RuntimeError)
83
- ./features/step_definitions/sample_steps.rb:2:in `flunker'
84
- ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
85
- features/outline_sample.feature:6:in `Given <state> without a table'
73
+ Examples: Rainbow colours
74
+ | state | other_state |
75
+ | failing | passing |
76
+ FAIL (RuntimeError)
77
+ ./features/step_definitions/sample_steps.rb:2:in `flunker'
78
+ ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
79
+ features/outline_sample.feature:6:in `Given <state> without a table'
86
80
 
87
- 1 scenario
88
- 1 failed step
89
- 1 skipped step
81
+ 1 scenario (1 failed)
82
+ 2 steps (1 failed, 1 skipped)
90
83
 
91
84
  """
92
85
 
@@ -106,11 +99,8 @@ Feature: Cucumber command line
106
99
  ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
107
100
  features/outline_sample.feature:6:in `Given <state> without a table'
108
101
 
109
- 5 scenarios
110
- 1 failed step
111
- 2 skipped steps
112
- 1 undefined step
113
- 4 passed steps
102
+ 5 scenarios (1 failed, 1 undefined, 3 passed)
103
+ 8 steps (1 failed, 2 skipped, 1 undefined, 4 passed)
114
104
 
115
105
  """
116
106
 
@@ -24,20 +24,20 @@ Feature: Multiline description names
24
24
  yawn
25
25
  Given <state> without a table # features/step_definitions/sample_steps.rb:12
26
26
 
27
- Examples:
28
- | state |
29
- | passing |
27
+ Examples:
28
+ | state |
29
+ | passing |
30
30
 
31
31
  Scenario Outline: name # features/multiline_name.feature:21
32
32
  Given <state> without a table # features/step_definitions/sample_steps.rb:12
33
33
 
34
- Examples: I'm a multiline name
35
- which goes on and on and on for three lines
36
- yawn
37
- | state |
38
- | passing |
34
+ Examples: I'm a multiline name
35
+ which goes on and on and on for three lines
36
+ yawn
37
+ | state |
38
+ | passing |
39
39
 
40
- 3 scenarios
41
- 6 passed steps
40
+ 3 scenarios (3 passed)
41
+ 6 steps (6 passed)
42
42
 
43
43
  """
@@ -6,127 +6,120 @@ Feature: Rake task
6
6
  Background:
7
7
  Given a standard Cucumber project directory structure
8
8
  And a file named "features/missing_step_definitions.feature" with:
9
- """
10
- Feature: Sample
9
+ """
10
+ Feature: Sample
11
11
 
12
- Scenario: Wanted
13
- Given I want to run this
12
+ Scenario: Wanted
13
+ Given I want to run this
14
14
 
15
- Scenario: Unwanted
16
- Given I don't want this ran
17
- """
15
+ Scenario: Unwanted
16
+ Given I don't want this ran
17
+ """
18
18
 
19
19
 
20
20
  Scenario: rake task with a defined profile
21
21
  Given the following profile is defined:
22
- """
23
- foo: --quiet --no-color features/missing_step_definitions.feature:3
24
- """
22
+ """
23
+ foo: --quiet --no-color features/missing_step_definitions.feature:3
24
+ """
25
25
  And a file named "Rakefile" with:
26
- """
27
- $LOAD_PATH.unshift(CUCUMBER_LIB)
28
- require 'cucumber/rake/task'
29
-
30
- Cucumber::Rake::Task.new(:features) do |t|
31
- t.profile = "foo"
32
- end
33
- """
34
-
26
+ """
27
+ $LOAD_PATH.unshift(CUCUMBER_LIB)
28
+ require 'cucumber/rake/task'
29
+
30
+ Cucumber::Rake::Task.new(:features) do |t|
31
+ t.profile = "foo"
32
+ end
33
+ """
35
34
  When I run rake features
36
35
  Then it should pass
37
36
  And the output should contain
38
- """
39
- Feature: Sample
37
+ """
38
+ Feature: Sample
40
39
 
41
- Scenario: Wanted
42
- Given I want to run this
40
+ Scenario: Wanted
41
+ Given I want to run this
43
42
 
44
- 1 scenario
45
- 1 undefined step
46
- """
43
+ 1 scenario (1 undefined)
44
+ 1 step (1 undefined)
45
+ """
47
46
 
48
47
  Scenario: rake task with a defined profile and cucumber_opts
49
48
  Given the following profile is defined:
50
- """
51
- bar: features/missing_step_definitions.feature:3
52
- """
49
+ """
50
+ bar: features/missing_step_definitions.feature:3
51
+ """
53
52
  And a file named "Rakefile" with:
54
- """
55
- $LOAD_PATH.unshift(CUCUMBER_LIB)
56
- require 'cucumber/rake/task'
57
-
58
- Cucumber::Rake::Task.new(:features) do |t|
59
- t.profile = "bar"
60
- t.cucumber_opts = "--quiet --no-color"
61
- end
62
- """
63
-
53
+ """
54
+ $LOAD_PATH.unshift(CUCUMBER_LIB)
55
+ require 'cucumber/rake/task'
56
+
57
+ Cucumber::Rake::Task.new(:features) do |t|
58
+ t.profile = "bar"
59
+ t.cucumber_opts = "--quiet --no-color"
60
+ end
61
+ """
64
62
  When I run rake features
65
63
  Then it should pass
66
64
  And the output should contain
67
- """
68
- Feature: Sample
65
+ """
66
+ Feature: Sample
69
67
 
70
- Scenario: Wanted
71
- Given I want to run this
68
+ Scenario: Wanted
69
+ Given I want to run this
72
70
 
73
- 1 scenario
74
- 1 undefined step
75
- """
71
+ 1 scenario (1 undefined)
72
+ 1 step (1 undefined)
73
+ """
76
74
 
77
75
  Scenario: rake task with a defined profile and feature list
78
76
  Given a file named "features/the_one_i_want_to_run.feature" with:
79
- """
80
- Feature: Desired
81
-
82
- Scenario: Something
83
- Given this is missing
84
- """
85
- Given the following profile is defined:
86
- """
87
- baz: --quiet --no-color
88
- """
89
- And a file named "Rakefile" with:
90
- """
91
- $LOAD_PATH.unshift(CUCUMBER_LIB)
92
- require 'cucumber/rake/task'
93
-
94
- Cucumber::Rake::Task.new(:features) do |t|
95
- t.profile = "baz"
96
- t.feature_list = ['features/the_one_i_want_to_run.feature']
97
- end
98
- """
77
+ """
78
+ Feature: Desired
99
79
 
80
+ Scenario: Something
81
+ Given this is missing
82
+ """
83
+ Given the following profile is defined:
84
+ """
85
+ baz: --quiet --no-color
86
+ """
87
+ And a file named "Rakefile" with:
88
+ """
89
+ $LOAD_PATH.unshift(CUCUMBER_LIB)
90
+ require 'cucumber/rake/task'
91
+
92
+ Cucumber::Rake::Task.new(:features) do |t|
93
+ t.profile = "baz"
94
+ t.feature_list = ['features/the_one_i_want_to_run.feature']
95
+ end
96
+ """
100
97
  When I run rake features
101
98
  Then it should pass
102
99
  And the output should contain
103
- """
104
- Feature: Desired
100
+ """
101
+ Feature: Desired
105
102
 
106
- Scenario: Something
107
- Given this is missing
103
+ Scenario: Something
104
+ Given this is missing
108
105
 
109
- 1 scenario
110
- 1 undefined step
111
- """
106
+ 1 scenario (1 undefined)
107
+ 1 step (1 undefined)
108
+ """
112
109
 
113
110
  Scenario: deprecation warnings
114
111
  Given a file named "Rakefile" with:
115
- """
116
- $LOAD_PATH.unshift(CUCUMBER_LIB)
117
- require 'cucumber/rake/task'
118
-
119
- Cucumber::Rake::Task.new(:features) do |t|
120
- t.feature_list = ['features/missing_step_definitions.feature']
121
- end
122
- """
112
+ """
113
+ $LOAD_PATH.unshift(CUCUMBER_LIB)
114
+ require 'cucumber/rake/task'
115
+
116
+ Cucumber::Rake::Task.new(:features) do |t|
117
+ t.feature_list = ['features/missing_step_definitions.feature']
118
+ end
119
+ """
123
120
  When I run rake features
124
121
  Then it should pass
125
122
  And STDERR should match
126
- """
127
- Cucumber::Rake::Task#feature_list is deprecated and will be removed in 0.4.0. Please use profiles for complex settings: http://wiki.github.com/aslakhellesoy/cucumber/using-rake#profiles
128
- """
129
-
130
-
131
-
132
-
123
+ """
124
+ Cucumber::Rake::Task#feature_list is deprecated and will be removed in 0.4.0. Please use profiles for complex settings: http://wiki.github.com/aslakhellesoy/cucumber/using-rake#profiles
125
+ """
@@ -20,8 +20,8 @@ Feature: Cucumber command line
20
20
  ./features/step_definitions/sample_steps.rb:20:in `/^a step definition that calls an undefined step$/'
21
21
  features/call_undefined_step_from_step_def.feature:7:in `Given call step "a step definition that calls an undefined step"'
22
22
 
23
- 2 scenarios
24
- 2 undefined steps
23
+ 2 scenarios (2 undefined)
24
+ 2 steps (2 undefined)
25
25
 
26
26
  You can implement step definitions for undefined steps with these snippets:
27
27
 
@@ -80,6 +80,11 @@ module Cucumber
80
80
  @step_invocations.passed?
81
81
  end
82
82
 
83
+ # Returns the status
84
+ def status
85
+ @step_invocations.status
86
+ end
87
+
83
88
  private
84
89
 
85
90
  def header?
@@ -45,6 +45,11 @@ module Cucumber
45
45
  @steps.exception
46
46
  end
47
47
 
48
+ # Returns the status
49
+ def status
50
+ @steps.status
51
+ end
52
+
48
53
  def skip_invoke!
49
54
  @steps.each{|step_invocation| step_invocation.skip_invoke!}
50
55
  @feature.next_feature_element(self) do |next_one|
@@ -55,11 +55,16 @@ module Cucumber
55
55
  end
56
56
 
57
57
  def failed?
58
- @steps.detect{|step_invocation| step_invocation.status == :failed}
58
+ status == :failed
59
59
  end
60
60
 
61
61
  def passed?
62
- @steps.detect{|step_invocation| step_invocation.status != :passed}.nil?
62
+ status == :passed
63
+ end
64
+
65
+ def status
66
+ @steps.each{|step_invocation| return step_invocation.status if step_invocation.status != :passed}
67
+ :passed
63
68
  end
64
69
 
65
70
  def to_sexp
@@ -192,7 +192,7 @@ module Cucumber
192
192
  end
193
193
 
194
194
  def has_text?(text)
195
- raw.flatten.detect{|cell_value| cell_value.index(text)}
195
+ raw.flatten.compact.detect{|cell_value| cell_value.index(text)}
196
196
  end
197
197
 
198
198
  def cells_rows
@@ -51,17 +51,15 @@ module Cucumber
51
51
  end
52
52
 
53
53
  def print_counts
54
- @io.puts dump_count(step_mother.scenarios.length, "scenario")
54
+ @io.print dump_count(step_mother.scenarios.length, "scenario")
55
+ print_status_counts{|status| step_mother.scenarios(status)}
55
56
 
56
- [:failed, :skipped, :undefined, :pending, :passed].each do |status|
57
- if step_mother.steps(status).any?
58
- count_string = dump_count(step_mother.steps(status).length, "step", status.to_s)
59
- @io.puts format_string(count_string, status)
60
- @io.flush
61
- end
62
- end
63
- end
57
+ @io.print dump_count(step_mother.steps.length, "step")
58
+ print_status_counts{|status| step_mother.steps(status)}
64
59
 
60
+ @io.flush
61
+ end
62
+
65
63
  def print_exception(e, status, indent)
66
64
  if @options[:strict] || !(Undefined === e) || e.nested?
67
65
  @io.puts(format_string("#{e.message} (#{e.class})\n#{e.backtrace.join("\n")}".indent(indent), status))
@@ -95,6 +93,14 @@ module Cucumber
95
93
 
96
94
  private
97
95
 
96
+ def print_status_counts
97
+ counts = [:failed, :skipped, :undefined, :pending, :passed].map do |status|
98
+ elements = yield status
99
+ elements.any? ? format_string("#{elements.length} #{status.to_s}", status) : nil
100
+ end
101
+ @io.puts(" (#{counts.compact.join(', ')})")
102
+ end
103
+
98
104
  def dump_count(count, what, state=nil)
99
105
  [count, state, "#{what}#{count == 1 ? '' : 's'}"].compact.join(" ")
100
106
  end
@@ -96,10 +96,10 @@ module Cucumber
96
96
 
97
97
  def visit_examples_name(keyword, name)
98
98
  names = name.empty? ? [name] : name.split("\n")
99
- @io.puts("\n #{keyword} #{names[0]}")
100
- names[1..-1].each {|s| @io.puts " #{s}" }
99
+ @io.puts("\n #{keyword} #{names[0]}")
100
+ names[1..-1].each {|s| @io.puts " #{s}" }
101
101
  @io.flush
102
- @indent = 4
102
+ @indent = 6
103
103
  end
104
104
 
105
105
  def visit_scenario_name(keyword, name, file_colon_line, source_indent)
@@ -1474,7 +1474,6 @@ module Cucumber
1474
1474
  end
1475
1475
 
1476
1476
  module LinesToKeyword0
1477
-
1478
1477
  def build
1479
1478
  elements.map{|s| s.build}.join("\n")
1480
1479
  end
@@ -270,10 +270,10 @@ module Cucumber
270
270
  end
271
271
 
272
272
  rule lines_to_keyword
273
- (line_to_keyword)* {
274
- def build
275
- elements.map{|s| s.build}.join("\n")
276
- end
273
+ line_to_keyword* {
274
+ def build
275
+ elements.map{|s| s.build}.join("\n")
276
+ end
277
277
  }
278
278
  end
279
279
 
@@ -7,8 +7,14 @@ else
7
7
  require 'action_controller/test_process'
8
8
  require 'action_controller/integration'
9
9
  end
10
- require 'test/unit/testresult'
11
10
 
11
+ begin
12
+ require 'test/unit/testresult'
13
+ rescue LoadError => e
14
+ e.message << "\nYou must gem install test-unit. For more info see https://rspec.lighthouseapp.com/projects/16211/tickets/292"
15
+ e.message << "\nAlso make sure you have rack 1.0.0 or higher."
16
+ raise e
17
+ end
12
18
 
13
19
  # So that Test::Unit doesn't launch at the end - makes it think it has already been run.
14
20
  Test::Unit.run = true if Test::Unit.respond_to?(:run=)
@@ -105,8 +105,13 @@ module Cucumber
105
105
  end
106
106
  end
107
107
 
108
- def scenarios
108
+ def scenarios(status = nil)
109
109
  @scenarios ||= []
110
+ if(status)
111
+ @scenarios.select{|scenario| scenario.status == status}
112
+ else
113
+ @scenarios
114
+ end
110
115
  end
111
116
 
112
117
  # Registers a new StepDefinition. This method is aliased
@@ -3,7 +3,7 @@ module Cucumber #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
5
  TINY = 1
6
- PATCH = nil # Set to nil for official release
6
+ PATCH = 1 # Set to nil for official release
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
9
9
  end
@@ -129,7 +129,7 @@ module Cucumber
129
129
  it "should recognise when just a subset of a cell is delimited" do
130
130
  table = Table.new([
131
131
  %w{qty book},
132
- ['<qty>', "This is <who>'s book"]
132
+ [nil, "This is <who>'s book"]
133
133
  ])
134
134
  table.should have_text('<who>')
135
135
  end
@@ -0,0 +1,27 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+ require 'cucumber/step_mother'
3
+ require 'cucumber/ast'
4
+
5
+ module Cucumber
6
+ module Ast
7
+ describe Visitor do
8
+
9
+ it "should support checking scenario name matches regexps" do
10
+ visitor = Visitor.new(mock("step mother"))
11
+ scenario = Scenario.new(background=nil,
12
+ comment=Comment.new(""),
13
+ tags=Tags.new(0, []),
14
+ line=99,
15
+ keyword="",
16
+ name="test name",
17
+ steps=[])
18
+
19
+ visitor.options = {:name_regexps => [/name/]}
20
+
21
+ visitor.matches_scenario_names?(scenario).should be_true
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+
@@ -304,6 +304,18 @@ Examples: I'm a multiline name
304
304
  [:row, 8,
305
305
  [:cell, "5"]]]]]]
306
306
  end
307
+
308
+ it "should allow Examples to have multiline names" do
309
+ pending('https://rspec.lighthouseapp.com/projects/16211/tickets/307-031-step-mother-parses-scenario-titles') do
310
+ parse(%{Feature: Hi
311
+ Scenario: When I have when in scenario
312
+ Given I am a step
313
+ }).to_sexp.should ==
314
+ [:feature, nil, "Feature: Hi",
315
+ [:scenario, 2, "Scenario:", "When I have when in scenario",
316
+ [:step, 3, "Given", "I am a step"]]]
317
+ end
318
+ end
307
319
  end
308
320
 
309
321
  describe "Syntax" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aslakhellesoy-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Aslak Helles\xC3\xB8y"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-26 00:00:00 -07:00
12
+ date: 2009-04-28 00:00:00 -07:00
13
13
  default_executable: cucumber
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -249,6 +249,7 @@ files:
249
249
  - examples/self_test/features/multiline_name.feature
250
250
  - examples/self_test/features/outline_sample.feature
251
251
  - examples/self_test/features/sample.feature
252
+ - examples/self_test/features/search_sample.feature
252
253
  - examples/self_test/features/step_definitions/sample_steps.rb
253
254
  - examples/self_test/features/support/env.rb
254
255
  - examples/self_test/features/support/tag_count_formatter.rb
@@ -404,6 +405,7 @@ files:
404
405
  - spec/cucumber/ast/step_collection_spec.rb
405
406
  - spec/cucumber/ast/step_spec.rb
406
407
  - spec/cucumber/ast/table_spec.rb
408
+ - spec/cucumber/ast/visitor_spec.rb
407
409
  - spec/cucumber/broadcaster_spec.rb
408
410
  - spec/cucumber/cli/configuration_spec.rb
409
411
  - spec/cucumber/cli/main_spec.rb