cucumber 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +16 -0
- data/Manifest.txt +6 -0
- data/examples/i18n/he/Rakefile +6 -0
- data/examples/i18n/he/features/addition.feature +16 -0
- data/examples/i18n/he/features/division.feature +9 -0
- data/examples/i18n/he/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/he/lib/calculator.rb +14 -0
- data/examples/self_test/features/search_sample.feature +10 -0
- data/examples/watir/features/search.feature +4 -1
- data/examples/watir/features/step_definitons/search_steps.rb +2 -4
- data/features/background.feature +30 -35
- data/features/cucumber_cli.feature +78 -68
- data/features/cucumber_cli_diff_disabled.feature +4 -4
- data/features/cucumber_cli_outlines.feature +43 -53
- data/features/multiline_names.feature +10 -10
- data/features/rake_task.feature +104 -86
- data/features/report_called_undefined_steps.feature +2 -2
- data/features/step_definitions/cucumber_steps.rb +8 -0
- data/features/usage.feature +1 -0
- data/lib/cucumber/ast/outline_table.rb +5 -0
- data/lib/cucumber/ast/scenario.rb +5 -0
- data/lib/cucumber/ast/step_collection.rb +7 -2
- data/lib/cucumber/ast/table.rb +1 -1
- data/lib/cucumber/formatter/console.rb +15 -9
- data/lib/cucumber/formatter/pretty.rb +3 -3
- data/lib/cucumber/formatter/progress.rb +8 -9
- data/lib/cucumber/languages.yml +16 -1
- data/lib/cucumber/parser/feature.rb +9 -2
- data/lib/cucumber/parser/feature.tt +13 -5
- data/lib/cucumber/parser/treetop_ext.rb +9 -0
- data/lib/cucumber/rails/world.rb +7 -1
- data/lib/cucumber/rake/task.rb +2 -0
- data/lib/cucumber/step_mother.rb +6 -1
- data/lib/cucumber/version.rb +1 -1
- data/spec/cucumber/ast/table_spec.rb +1 -1
- data/spec/cucumber/formatter/progress_spec.rb +35 -0
- data/spec/cucumber/parser/feature_parser_spec.rb +12 -0
- metadata +8 -2
data/History.txt
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
== 0.3.2 2009-05-05
|
2
|
+
|
3
|
+
This release has some minor bug fixes and new features.
|
4
|
+
Nothing major, but we need a release for RailsConf'09 in Las Vegas!
|
5
|
+
|
6
|
+
=== Bugfixes
|
7
|
+
* rake tasks with profiles not respecting --require flags (#311 Ben Mabey)
|
8
|
+
* Step table with blank cell fails (#308 JohnnyT)
|
9
|
+
* Fixed error where unused table cells in Examples where raising exceptions due to having no status (#302 Joseph Wilk)
|
10
|
+
|
11
|
+
=== New features
|
12
|
+
* Support for Hebrew (Ido Kanner)
|
13
|
+
* Summary should report scenarios (#32 Aslak Hellesøy)
|
14
|
+
* Examples and the associated tables are indented one level deeper than Scenario Outline. (Aslak Hellesøy)
|
15
|
+
* Added support for Examples selection when using --name. (#295 Joseph Wilk)
|
16
|
+
|
1
17
|
== 0.3.1 2009-04-26
|
2
18
|
|
3
19
|
This release has several minor bug fixes and new features. With the addition of Latvian and Hungarian Cucumber
|
data/Manifest.txt
CHANGED
@@ -67,6 +67,11 @@ examples/i18n/fr/Rakefile
|
|
67
67
|
examples/i18n/fr/features/addition.feature
|
68
68
|
examples/i18n/fr/features/step_definitions/calculatrice_steps.rb
|
69
69
|
examples/i18n/fr/lib/calculatrice.rb
|
70
|
+
examples/i18n/he/Rakefile
|
71
|
+
examples/i18n/he/features/addition.feature
|
72
|
+
examples/i18n/he/features/division.feature
|
73
|
+
examples/i18n/he/features/step_definitons/calculator_steps.rb
|
74
|
+
examples/i18n/he/lib/calculator.rb
|
70
75
|
examples/i18n/hu/Rakefile
|
71
76
|
examples/i18n/hu/features/addition.feature
|
72
77
|
examples/i18n/hu/features/division.feature
|
@@ -341,6 +346,7 @@ spec/cucumber/formatter/html/cucumber.js
|
|
341
346
|
spec/cucumber/formatter/html/index.html
|
342
347
|
spec/cucumber/formatter/html/jquery-1.3.min.js
|
343
348
|
spec/cucumber/formatter/html/jquery.uitableedit.js
|
349
|
+
spec/cucumber/formatter/progress_spec.rb
|
344
350
|
spec/cucumber/parser/feature_parser_spec.rb
|
345
351
|
spec/cucumber/parser/table_parser_spec.rb
|
346
352
|
spec/cucumber/rails/stubs/mini_rails.rb
|
@@ -0,0 +1,16 @@
|
|
1
|
+
תכונה: חיבור
|
2
|
+
כדי למנוע טעויות טפשיות
|
3
|
+
בתור בור מתמטי
|
4
|
+
אני רוצה שיגידו לי את הסכום של שני מספרים
|
5
|
+
|
6
|
+
תבנית תרחיש: חבר שני מספרים
|
7
|
+
בהינתן שהזנתי <קלט_1> למחשבון
|
8
|
+
וגם שהזנתי <קלט_2> למחשבון
|
9
|
+
כאשר אני לוחץ על <כפתור>
|
10
|
+
אז התוצאה על המסך צריכה להיות <פלט>
|
11
|
+
|
12
|
+
דוגמאות:
|
13
|
+
| קלט_1 | קלט_2 | כפתור | פלט |
|
14
|
+
| 20 | 30 | חבר | 50 |
|
15
|
+
| 2 | 5 | חבר | 7 |
|
16
|
+
| 0 | 40 | חבר | 40 |
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec/expectations'
|
3
|
+
$:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
|
4
|
+
require 'cucumber/formatter/unicode'
|
5
|
+
require 'calculator'
|
6
|
+
|
7
|
+
Before do
|
8
|
+
@calc = Calculator.new
|
9
|
+
end
|
10
|
+
|
11
|
+
After do
|
12
|
+
end
|
13
|
+
|
14
|
+
Given /שהזנתי (\d+) למחשבון/ do |n|
|
15
|
+
@calc.push n.to_i
|
16
|
+
end
|
17
|
+
|
18
|
+
When /אני לוחץ על (\w+)/ do |op|
|
19
|
+
@result = @calc.send op
|
20
|
+
end
|
21
|
+
|
22
|
+
Then /התוצאה על המסך צריכה להיות (.*)/ do |result|
|
23
|
+
@result.should == result.to_f
|
24
|
+
end
|
@@ -6,4 +6,7 @@ Feature: Search
|
|
6
6
|
Scenario: Find what I'm looking for
|
7
7
|
Given I am on the Google search page
|
8
8
|
When I search for "cucumber github"
|
9
|
-
Then I should see
|
9
|
+
Then I should see
|
10
|
+
"""
|
11
|
+
BDD that talks to domain experts first and code second
|
12
|
+
"""
|
@@ -10,10 +10,8 @@ When /I search for "(.*)"/ do |query|
|
|
10
10
|
@browser.button(:name, 'btnG').click
|
11
11
|
end
|
12
12
|
|
13
|
-
Then /I should see
|
14
|
-
|
15
|
-
link.should_not == nil
|
16
|
-
link.text.should == text
|
13
|
+
Then /I should see/ do |text|
|
14
|
+
@browser.text.should =~ /#{text}/m
|
17
15
|
end
|
18
16
|
|
19
17
|
# To avoid step definitions that are tightly coupled to your user interface,
|
data/features/background.feature
CHANGED
@@ -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
|
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
|
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
|
-
|
56
|
-
|
57
|
-
|
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
|
-
|
63
|
-
|
64
|
-
|
62
|
+
Examples:
|
63
|
+
| count |
|
64
|
+
| 10 |
|
65
65
|
|
66
|
-
2 scenarios
|
67
|
-
4 passed
|
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
|
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
|
-
|
116
|
-
|
117
|
-
|
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
|
-
|
123
|
-
|
124
|
-
|
121
|
+
Examples:
|
122
|
+
| count |
|
123
|
+
| 10 |
|
125
124
|
|
126
|
-
2 scenarios
|
127
|
-
1 failed
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
-
|
212
|
-
|
213
|
-
|
208
|
+
Examples:
|
209
|
+
| state |
|
210
|
+
| passing |
|
214
211
|
|
215
212
|
Scenario Outline: name
|
216
213
|
Given <state> without a table
|
217
214
|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
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
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
229
|
+
Examples: Rainbow colours
|
230
|
+
| state | other_state |
|
231
|
+
| missing | passing |
|
232
|
+
| passing | passing |
|
233
|
+
| failing | passing |
|
237
234
|
|
238
|
-
|
239
|
-
|
240
|
-
|
235
|
+
Examples: Only passing
|
236
|
+
| state | other_state |
|
237
|
+
| passing | passing |
|
241
238
|
|
242
239
|
@one
|
243
240
|
Feature: Sample
|
@@ -273,16 +270,27 @@ Feature: Cucumber command line
|
|
273
270
|
Scenario Outline: Ignore me
|
274
271
|
Given <state> without a table
|
275
272
|
|
276
|
-
|
277
|
-
|
278
|
-
|
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
|
-
|
284
|
-
|
285
|
-
|
280
|
+
Examples:
|
281
|
+
| state |
|
282
|
+
| passing |
|
283
|
+
|
284
|
+
Scenario Outline: no match in name but in examples
|
285
|
+
Given <state> without a table
|
286
|
+
|
287
|
+
Examples: Hantu Pisang
|
288
|
+
| state |
|
289
|
+
| passing |
|
290
|
+
|
291
|
+
Examples: Ignore me
|
292
|
+
| state |
|
293
|
+
| failing |
|
286
294
|
|
287
295
|
Feature: undefined multiline args
|
288
296
|
|
@@ -296,10 +304,9 @@ Feature: Cucumber command line
|
|
296
304
|
Given a table
|
297
305
|
| table |
|
298
306
|
| example |
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
9 undefined steps
|
307
|
+
|
308
|
+
23 scenarios (17 skipped, 5 undefined, 1 passed)
|
309
|
+
39 steps (30 skipped, 9 undefined)
|
303
310
|
|
304
311
|
"""
|
305
312
|
|
@@ -309,11 +316,11 @@ Feature: Cucumber command line
|
|
309
316
|
"""
|
310
317
|
UUUUU
|
311
318
|
|
312
|
-
1 scenario
|
313
|
-
5 undefined
|
319
|
+
1 scenario (1 undefined)
|
320
|
+
5 steps (5 undefined)
|
314
321
|
|
315
322
|
"""
|
316
|
-
And "examples/self_test/tmp/pretty.txt" should
|
323
|
+
And "examples/self_test/tmp/pretty.txt" should contain
|
317
324
|
"""
|
318
325
|
Feature: Lots of undefined
|
319
326
|
|
@@ -323,9 +330,9 @@ Feature: Cucumber command line
|
|
323
330
|
And it's 40 degrees in Norway
|
324
331
|
When I stop procrastinating
|
325
332
|
And there is world peace
|
326
|
-
|
327
|
-
1 scenario
|
328
|
-
5 undefined
|
333
|
+
|
334
|
+
1 scenario (1 undefined)
|
335
|
+
5 steps (5 undefined)
|
329
336
|
|
330
337
|
"""
|
331
338
|
|
@@ -344,12 +351,19 @@ Feature: Cucumber command line
|
|
344
351
|
Scenario Outline: Hantu Pisang match
|
345
352
|
Given <state> without a table
|
346
353
|
|
347
|
-
|
348
|
-
|
349
|
-
|
354
|
+
Examples:
|
355
|
+
| state |
|
356
|
+
| passing |
|
357
|
+
|
358
|
+
Scenario Outline: no match in name but in examples
|
359
|
+
Given <state> without a table
|
360
|
+
|
361
|
+
Examples: Hantu Pisang
|
362
|
+
| state |
|
363
|
+
| passing |
|
350
364
|
|
351
|
-
|
352
|
-
|
365
|
+
3 scenarios (3 passed)
|
366
|
+
6 steps (6 passed)
|
353
367
|
|
354
368
|
"""
|
355
369
|
|
@@ -362,8 +376,8 @@ Feature: Cucumber command line
|
|
362
376
|
Background: Hantu Pisang background match
|
363
377
|
Given passing without a table
|
364
378
|
|
365
|
-
0 scenarios
|
366
|
-
1 passed
|
379
|
+
0 scenarios ()
|
380
|
+
1 step (1 passed)
|
367
381
|
|
368
382
|
"""
|
369
383
|
|
@@ -385,9 +399,8 @@ Feature: Cucumber command line
|
|
385
399
|
| a | b |
|
386
400
|
| c | d |
|
387
401
|
|
388
|
-
2 scenarios
|
389
|
-
1 undefined
|
390
|
-
1 passed step
|
402
|
+
2 scenarios (1 undefined, 1 passed)
|
403
|
+
2 steps (1 undefined, 1 passed)
|
391
404
|
|
392
405
|
"""
|
393
406
|
|
@@ -419,10 +432,8 @@ Feature: Cucumber command line
|
|
419
432
|
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
|
420
433
|
features/sample.feature:16:in `Given failing'
|
421
434
|
|
422
|
-
3 scenarios
|
423
|
-
1 failed
|
424
|
-
1 undefined step
|
425
|
-
1 passed step
|
435
|
+
3 scenarios (1 failed, 1 undefined, 1 passed)
|
436
|
+
3 steps (1 failed, 1 undefined, 1 passed)
|
426
437
|
|
427
438
|
"""
|
428
439
|
|
@@ -443,9 +454,8 @@ Feature: Cucumber command line
|
|
443
454
|
| a | b |
|
444
455
|
| c | d |
|
445
456
|
|
446
|
-
2 scenarios
|
447
|
-
1 skipped
|
448
|
-
1 undefined step
|
457
|
+
2 scenarios (1 skipped, 1 undefined)
|
458
|
+
2 steps (1 skipped, 1 undefined)
|
449
459
|
|
450
460
|
"""
|
451
461
|
|