cucumber 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +7 -9
  3. data/History.md +295 -265
  4. data/README.md +9 -7
  5. data/cucumber.gemspec +2 -2
  6. data/features/docs/cli/dry_run.feature +0 -3
  7. data/features/docs/cli/finding_steps.feature +28 -0
  8. data/features/docs/cli/run_specific_scenarios.feature +3 -1
  9. data/features/docs/cli/specifying_multiple_formatters.feature +22 -1
  10. data/features/docs/defining_steps/nested_steps.feature +0 -1
  11. data/features/docs/defining_steps/printing_messages.feature +4 -4
  12. data/features/docs/defining_steps/skip_scenario.feature +0 -2
  13. data/features/docs/exception_in_around_hook.feature +1 -3
  14. data/features/docs/formatters/html_formatter.feature +1 -0
  15. data/features/docs/formatters/json_formatter.feature +73 -62
  16. data/features/docs/formatters/junit_formatter.feature +130 -38
  17. data/features/docs/formatters/rerun_formatter.feature +60 -8
  18. data/features/docs/formatters/usage_formatter.feature +3 -7
  19. data/features/docs/getting_started.feature +1 -1
  20. data/features/docs/gherkin/background.feature +0 -11
  21. data/features/docs/gherkin/language_help.feature +5 -0
  22. data/features/docs/gherkin/outlines.feature +1 -3
  23. data/features/docs/gherkin/using_descriptions.feature +0 -1
  24. data/features/docs/raketask.feature +1 -1
  25. data/features/docs/writing_support_code/after_hooks.feature +22 -0
  26. data/features/lib/step_definitions/aruba_steps.rb +4 -0
  27. data/features/lib/step_definitions/junit_steps.rb +1 -1
  28. data/features/lib/support/normalise_output.rb +21 -4
  29. data/lib/cucumber/cli/configuration.rb +16 -13
  30. data/lib/cucumber/cli/main.rb +35 -10
  31. data/lib/cucumber/cli/options.rb +33 -9
  32. data/lib/cucumber/cli/rerun_file.rb +29 -0
  33. data/lib/cucumber/filters/prepare_world.rb +2 -3
  34. data/lib/cucumber/formatter/backtrace_filter.rb +40 -0
  35. data/lib/cucumber/formatter/console.rb +2 -3
  36. data/lib/cucumber/formatter/cucumber.css +1 -0
  37. data/lib/cucumber/formatter/duration_extractor.rb +28 -0
  38. data/lib/cucumber/formatter/hook_query_visitor.rb +40 -0
  39. data/lib/cucumber/formatter/html.rb +16 -1
  40. data/lib/cucumber/formatter/json.rb +287 -8
  41. data/lib/cucumber/formatter/junit.rb +92 -143
  42. data/lib/cucumber/formatter/legacy_api/adapter.rb +18 -54
  43. data/lib/cucumber/formatter/legacy_api/ast.rb +13 -0
  44. data/lib/cucumber/formatter/legacy_api/runtime_facade.rb +4 -0
  45. data/lib/cucumber/formatter/pretty.rb +2 -1
  46. data/lib/cucumber/formatter/progress.rb +20 -53
  47. data/lib/cucumber/formatter/rerun.rb +2 -1
  48. data/lib/cucumber/formatter/usage.rb +16 -22
  49. data/lib/cucumber/hooks.rb +18 -9
  50. data/lib/cucumber/multiline_argument/data_table.rb +40 -28
  51. data/lib/cucumber/platform.rb +1 -1
  52. data/lib/cucumber/rb_support/rb_hook.rb +4 -0
  53. data/lib/cucumber/running_test_case.rb +13 -4
  54. data/lib/cucumber/runtime/after_hooks.rb +7 -6
  55. data/lib/cucumber/runtime/before_hooks.rb +8 -4
  56. data/lib/cucumber/runtime/step_hooks.rb +5 -4
  57. data/lib/cucumber/runtime/support_code.rb +6 -15
  58. data/lib/cucumber/step_match.rb +1 -1
  59. data/spec/cucumber/cli/configuration_spec.rb +32 -5
  60. data/spec/cucumber/cli/main_spec.rb +3 -3
  61. data/spec/cucumber/cli/options_spec.rb +60 -1
  62. data/spec/cucumber/cli/rerun_spec.rb +89 -0
  63. data/spec/cucumber/formatter/html_spec.rb +84 -5
  64. data/spec/cucumber/formatter/json_spec.rb +757 -0
  65. data/spec/cucumber/formatter/junit_spec.rb +5 -5
  66. data/spec/cucumber/formatter/legacy_api/adapter_spec.rb +69 -8
  67. data/spec/cucumber/formatter/pretty_spec.rb +96 -0
  68. data/spec/cucumber/formatter/progress_spec.rb +85 -1
  69. data/spec/cucumber/formatter/rerun_spec.rb +3 -3
  70. data/spec/cucumber/multiline_argument/data_table_spec.rb +89 -0
  71. data/spec/cucumber/running_test_case_spec.rb +57 -1
  72. metadata +70 -60
  73. data/lib/cucumber/formatter/gherkin_formatter_adapter.rb +0 -204
  74. data/lib/cucumber/formatter/gpretty.rb +0 -24
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
- [![Build Status](https://secure.travis-ci.org/cucumber/cucumber.png)](http://travis-ci.org/cucumber/cucumber) [![Code Climate](https://codeclimate.com/github/cucumber/cucumber.png)](https://codeclimate.com/github/cucumber/cucumber) [![Coverage Status](https://coveralls.io/repos/cucumber/cucumber/badge.png?branch=master)](https://coveralls.io/r/cucumber/cucumber?branch=master) [![Dependency Status](https://gemnasium.com/cucumber/cucumber.png)](https://gemnasium.com/cucumber/cucumber)
1
+ [![Join the chat at https://gitter.im/cucumber/cucumber-ruby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cucumber/cucumber-ruby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://secure.travis-ci.org/cucumber/cucumber-ruby.png)](http://travis-ci.org/cucumber/cucumber-ruby) [![Code Climate](https://codeclimate.com/github/cucumber/cucumber-ruby.png)](https://codeclimate.com/github/cucumber/cucumber-ruby) [![Coverage Status](https://coveralls.io/repos/cucumber/cucumber-ruby/badge.png?branch=master)](https://coveralls.io/r/cucumber/cucumber-ruby?branch=master) [![Dependency Status](https://gemnasium.com/cucumber/cucumber-ruby.png)](https://gemnasium.com/cucumber/cucumber-ruby)
2
2
 
3
3
  # Cucumber
4
4
 
5
+
5
6
  Cucumber is a tool for running automated tests written in plain language. Because they're
6
7
  written in plain language, they can be read by anyone on your team. Because they can be
7
8
  read by anyone, you can use them to help improve communication, collaboration and trust on
@@ -9,14 +10,15 @@ your team.
9
10
 
10
11
  Where to get more info:
11
12
 
12
- * The main website: http://cukes.info/
13
- * Documentation: https://wiki.github.com/cucumber/cucumber/
14
- * API Documentation: http://cukes.info/api/cucumber/ruby/yardoc/
15
- * Support forum: https://groups.google.com/forum/?fromgroups#!forum/cukes
16
- * IRC channel: irc://irc.freenode.net/cucumber
13
+ * The main website: https://cucumber.io/
14
+ * Documentation: https://github.com/cucumber/cucumber/wiki
15
+ * Ruby API Documentation: http://www.rubydoc.info/github/cucumber/cucumber/
16
+ * Support forum: https://groups.google.com/group/cukes
17
+ * Developer chat: https://gitter.im/cucumber/cucumber-ruby
18
+ * IRC channel: [irc://irc.freenode.net/cucumber](irc://irc.freenode.net/cucumber)
17
19
 
18
20
  See [CONTRIBUTING.md](CONTRIBUTING.md) for info on contributing to Cucumber.
19
21
 
20
22
  ## Copyright
21
23
 
22
- Copyright (c) 2008-2013 Aslak Hellesøy and Contributors. See LICENSE for details.
24
+ Copyright (c) 2008-2015 Aslak Hellesøy and Contributors. See LICENSE for details.
@@ -5,7 +5,7 @@ require "cucumber/platform"
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'cucumber'
7
7
  s.version = Cucumber::VERSION
8
- s.authors = ["Aslak Hellesøy"]
8
+ s.authors = ["Aslak Hellesøy", "Matt Wynne", "Steve Tooke"]
9
9
  s.description = 'Behaviour Driven Development with elegance and joy'
10
10
  s.summary = "cucumber-#{s.version}"
11
11
  s.email = 'cukes@googlegroups.com'
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.platform = Gem::Platform::RUBY
15
15
  s.required_ruby_version = ">= 1.9.3"
16
16
 
17
- s.add_dependency 'cucumber-core', '~> 1.1.3'
17
+ s.add_dependency 'cucumber-core', '~> 1.2.0'
18
18
  s.add_dependency 'builder', '>= 2.1.2'
19
19
  s.add_dependency 'diff-lcs', '>= 1.1.3'
20
20
  s.add_dependency 'gherkin', '~> 2.12'
@@ -23,7 +23,6 @@ Feature: Dry Run
23
23
 
24
24
  1 scenario (1 skipped)
25
25
  1 step (1 skipped)
26
- 0m0.012s
27
26
 
28
27
  """
29
28
 
@@ -45,7 +44,6 @@ Feature: Dry Run
45
44
 
46
45
  1 scenario (1 skipped)
47
46
  1 step (1 skipped)
48
- 0m0.012s
49
47
 
50
48
  """
51
49
 
@@ -68,6 +66,5 @@ Feature: Dry Run
68
66
 
69
67
  1 scenario (1 undefined)
70
68
  1 step (1 undefined)
71
- 0m0.012s
72
69
 
73
70
  """
@@ -0,0 +1,28 @@
1
+ Feature: Loading the steps users expect
2
+ As a User
3
+ In order to run features in subdirectories without having to pass extra options
4
+ I want cucumber to load all step files
5
+
6
+ Scenario:
7
+ Given a file named "features/nesting/test.feature" with:
8
+ """
9
+ Feature: Feature in Subdirectory
10
+ Scenario: A step not in the subdirectory
11
+ Given not found in subdirectory
12
+ """
13
+ And a file named "features/step_definitions/steps_no_in_subdirectory.rb" with:
14
+ """
15
+ Given(/^not found in subdirectory$/) { }
16
+ """
17
+ When I run `cucumber -q features/nesting/test.feature`
18
+ Then it should pass with:
19
+ """
20
+ Feature: Feature in Subdirectory
21
+
22
+ Scenario: A step not in the subdirectory
23
+ Given not found in subdirectory
24
+
25
+ 1 scenario (1 passed)
26
+ 1 step (1 passed)
27
+ """
28
+
@@ -24,7 +24,7 @@ Feature: Run specific scenarios
24
24
  Given this step passes
25
25
  """
26
26
  When I run `cucumber features/test.feature:7 --format pretty --quiet`
27
- Then it should pass with:
27
+ Then it should pass with exactly:
28
28
  """
29
29
  Feature:
30
30
 
@@ -32,6 +32,8 @@ Feature: Run specific scenarios
32
32
  Given this step passes
33
33
 
34
34
  1 scenario (1 passed)
35
+ 1 step (1 passed)
36
+
35
37
  """
36
38
 
37
39
  Scenario: Use @-notation to specify a file containing feature file list
@@ -3,8 +3,9 @@ Feature: Running multiple formatters
3
3
 
4
4
  When running cucumber, you are able to using multiple different
5
5
  formatters and redirect the output to text files.
6
+ Two formatters cannot both print to the same file (or to STDOUT)
6
7
 
7
- Scenario: Multiple formatters and outputs
8
+ Background:
8
9
  Given a file named "features/test.feature" with:
9
10
  """
10
11
  Feature: Lots of undefined
@@ -16,6 +17,8 @@ Feature: Running multiple formatters
16
17
  When I stop procrastinating
17
18
  And there is world peace
18
19
  """
20
+
21
+ Scenario: Multiple formatters and outputs
19
22
  When I run `cucumber --no-color --format progress --out progress.txt --format pretty --out pretty.txt --no-source --dry-run --no-snippets features/test.feature`
20
23
  Then the stderr should not contain anything
21
24
  Then the file "progress.txt" should contain:
@@ -42,3 +45,21 @@ Feature: Running multiple formatters
42
45
 
43
46
  """
44
47
 
48
+ Scenario: Two formatters to stdout
49
+ When I run `cucumber -f progress -f pretty features/test.feature`
50
+ Then it should fail with:
51
+ """
52
+ All but one formatter must use --out, only one can print to each stream (or STDOUT) (RuntimeError)
53
+ """
54
+
55
+ Scenario: Two formatters to stdout when using a profile
56
+ Given the following profiles are defined:
57
+ """
58
+ default: -q
59
+ """
60
+ When I run `cucumber -f progress -f pretty features/test.feature`
61
+ Then it should fail with:
62
+ """
63
+ All but one formatter must use --out, only one can print to each stream (or STDOUT) (RuntimeError)
64
+ """
65
+
@@ -173,6 +173,5 @@ Feature: Nested Steps
173
173
 
174
174
  2 scenarios (2 failed)
175
175
  2 steps (2 failed)
176
- 0m0.012s
177
176
 
178
177
  """
@@ -137,12 +137,12 @@ Feature: Pretty formatter - Printing messages
137
137
  Announce
138
138
 
139
139
  Me
140
- ..-UUUUUU
140
+ ..UUU
141
141
  Announce with fail
142
- F--
142
+ F-
143
143
  Line: 1: anno1
144
- FFF
144
+ F
145
145
  Line: 2: anno2
146
- ...
146
+ .
147
147
  """
148
148
 
@@ -26,7 +26,6 @@ Feature: Skip Scenario
26
26
 
27
27
  1 scenario (1 skipped)
28
28
  2 steps (2 skipped)
29
- 0m0.012s
30
29
 
31
30
  """
32
31
 
@@ -56,7 +55,6 @@ Feature: Skip Scenario
56
55
 
57
56
  1 scenario (1 skipped)
58
57
  2 steps (2 skipped)
59
- 0m0.012s
60
58
 
61
59
  """
62
60
 
@@ -41,8 +41,7 @@ Feature: Exceptions in Around Hooks
41
41
 
42
42
  1 scenario (1 failed)
43
43
  0 steps
44
- 0m0.012s
45
-
44
+
46
45
  """
47
46
 
48
47
  Scenario: Exception after the test case is run
@@ -75,6 +74,5 @@ Feature: Exceptions in Around Hooks
75
74
 
76
75
  1 scenario (1 failed)
77
76
  1 step (1 passed)
78
- 0m0.012s
79
77
 
80
78
  """
@@ -88,3 +88,4 @@ Feature: HTML output formatter
88
88
  """
89
89
  makeRed('background_0')
90
90
  """
91
+
@@ -131,6 +131,10 @@ Feature: JSON output formatter
131
131
  "line": 5,
132
132
  "description": "",
133
133
  "tags": [
134
+ {
135
+ "name": "@a",
136
+ "line": 1
137
+ },
134
138
  {
135
139
  "name": "@b",
136
140
  "line": 4
@@ -159,6 +163,10 @@ Feature: JSON output formatter
159
163
  "line": 9,
160
164
  "description": "",
161
165
  "tags": [
166
+ {
167
+ "name": "@a",
168
+ "line": 1
169
+ },
162
170
  {
163
171
  "name": "@c",
164
172
  "line": 8
@@ -214,6 +222,10 @@ Feature: JSON output formatter
214
222
  "line": 5,
215
223
  "description": "",
216
224
  "tags": [
225
+ {
226
+ "name": "@a",
227
+ "line": 1
228
+ },
217
229
  {
218
230
  "name": "@b",
219
231
  "line": 4
@@ -242,6 +254,10 @@ Feature: JSON output formatter
242
254
  "line": 9,
243
255
  "description": "",
244
256
  "tags": [
257
+ {
258
+ "name": "@a",
259
+ "line": 1
260
+ },
245
261
  {
246
262
  "name": "@c",
247
263
  "line": 8
@@ -270,7 +286,7 @@ Feature: JSON output formatter
270
286
 
271
287
  """
272
288
 
273
- @spawn @wip-jruby
289
+ @spawn
274
290
  Scenario: DocString
275
291
  Given a file named "features/doc_string.feature" with:
276
292
  """
@@ -285,7 +301,7 @@ Feature: JSON output formatter
285
301
  And a file named "features/step_definitions/steps.rb" with:
286
302
  """
287
303
  Then /I should fail with/ do |s|
288
- raise s
304
+ raise RuntimeError, s
289
305
  end
290
306
  """
291
307
  When I run `cucumber --format json features/doc_string.feature`
@@ -333,7 +349,7 @@ Feature: JSON output formatter
333
349
  ]
334
350
  """
335
351
 
336
- @spawn
352
+ @spawn
337
353
  Scenario: embedding screenshot
338
354
  When I run `cucumber -b --format json features/embed.feature`
339
355
  Then it should pass with JSON:
@@ -381,6 +397,7 @@ Feature: JSON output formatter
381
397
 
382
398
  """
383
399
 
400
+ @spawn
384
401
  Scenario: scenario outline
385
402
  When I run `cucumber --format json features/outline.feature`
386
403
  Then it should fail with JSON:
@@ -395,75 +412,69 @@ Feature: JSON output formatter
395
412
  "description": "",
396
413
  "elements": [
397
414
  {
398
- "id": "an-outline-feature;outline",
415
+ "id": "an-outline-feature;outline;examples1;2",
399
416
  "keyword": "Scenario Outline",
400
417
  "name": "outline",
401
- "line": 3,
402
418
  "description": "",
403
- "type": "scenario_outline",
419
+ "line": 8,
420
+ "type": "scenario",
404
421
  "steps": [
405
422
  {
406
423
  "keyword": "Given ",
407
- "name": "this step <status>",
408
- "line": 4,
424
+ "name": "this step passes",
425
+ "line": 8,
409
426
  "match": {
410
- "location": "features/outline.feature:4"
427
+ "location": "features/step_definitions/steps.rb:1"
428
+ },
429
+ "result": {
430
+ "status": "passed",
431
+ "duration": 1
411
432
  }
412
433
  }
413
- ],
414
- "examples": [
434
+ ]
435
+ },
436
+ {
437
+ "id": "an-outline-feature;outline;examples1;3",
438
+ "keyword": "Scenario Outline",
439
+ "name": "outline",
440
+ "description": "",
441
+ "line": 9,
442
+ "type": "scenario",
443
+ "steps": [
415
444
  {
416
- "keyword": "Examples",
417
- "name": "examples1",
418
- "line": 6,
419
- "description": "",
420
- "id": "an-outline-feature;outline;examples1",
421
- "rows": [
422
- {
423
- "cells": [
424
- "status"
425
- ],
426
- "line": 7,
427
- "id": "an-outline-feature;outline;examples1;1"
428
- },
429
- {
430
- "cells": [
431
- "passes"
432
- ],
433
- "line": 8,
434
- "id": "an-outline-feature;outline;examples1;2"
435
- },
436
- {
437
- "cells": [
438
- "fails"
439
- ],
440
- "line": 9,
441
- "id": "an-outline-feature;outline;examples1;3"
442
- }
443
- ]
444
- },
445
+ "keyword": "Given ",
446
+ "name": "this step fails",
447
+ "line": 9,
448
+ "match": {
449
+ "location": "features/step_definitions/steps.rb:4"
450
+ },
451
+ "result": {
452
+ "status": "failed",
453
+ "error_message": " (RuntimeError)\n./features/step_definitions/steps.rb:4:in `/^this step fails$/'\nfeatures/outline.feature:9:in `Given this step fails'\nfeatures/outline.feature:4:in `Given this step <status>'",
454
+ "duration": 1
455
+ }
456
+ }
457
+ ]
458
+ },
459
+ {
460
+ "id": "an-outline-feature;outline;examples2;2",
461
+ "keyword": "Scenario Outline",
462
+ "name": "outline",
463
+ "description": "",
464
+ "line": 13,
465
+ "type": "scenario",
466
+ "steps": [
445
467
  {
446
- "keyword": "Examples",
447
- "name": "examples2",
448
- "line": 11,
449
- "description": "",
450
- "id": "an-outline-feature;outline;examples2",
451
- "rows": [
452
- {
453
- "cells": [
454
- "status"
455
- ],
456
- "line": 12,
457
- "id": "an-outline-feature;outline;examples2;1"
458
- },
459
- {
460
- "cells": [
461
- "passes"
462
- ],
463
- "line": 13,
464
- "id": "an-outline-feature;outline;examples2;2"
465
- }
466
- ]
468
+ "keyword": "Given ",
469
+ "name": "this step passes",
470
+ "line": 13,
471
+ "match": {
472
+ "location": "features/step_definitions/steps.rb:1"
473
+ },
474
+ "result": {
475
+ "status": "passed",
476
+ "duration": 1
477
+ }
467
478
  }
468
479
  ]
469
480
  }
@@ -735,7 +746,7 @@ Feature: JSON output formatter
735
746
  puts "Before hook 2"
736
747
  embed "src", "mime_type", "label"
737
748
  end
738
-
749
+
739
750
  AfterStep do
740
751
  puts "AfterStep hook 1"
741
752
  embed "src", "mime_type", "label"
@@ -53,9 +53,11 @@ Feature: JUnit output formatter
53
53
  Given this step <type>
54
54
 
55
55
  Examples:
56
- | type |
57
- | passes |
58
- | fails |
56
+ | type |
57
+ | passes |
58
+ | fails |
59
+ | is pending |
60
+ | is undefined |
59
61
  """
60
62
 
61
63
  Scenario: one feature, one passing scenario, one failing scenario
@@ -69,8 +71,12 @@ Feature: JUnit output formatter
69
71
  <?xml version="1.0" encoding="UTF-8"?>
70
72
  <testsuite failures="1" errors="0" skipped="0" tests="2" time="0.05" name="One passing scenario, one failing scenario">
71
73
  <testcase classname="One passing scenario, one failing scenario" name="Passing" time="0.05">
72
- <system-out/>
73
- <system-err/>
74
+ <system-out>
75
+ <![CDATA[]]>
76
+ </system-out>
77
+ <system-err>
78
+ <![CDATA[]]>
79
+ </system-err>
74
80
  </testcase>
75
81
  <testcase classname="One passing scenario, one failing scenario" name="Failing" time="0.05">
76
82
  <failure message="failed Failing" type="failed">
@@ -84,15 +90,13 @@ Feature: JUnit output formatter
84
90
  ./features/step_definitions/steps.rb:4:in `/^this step fails$/'
85
91
  features/one_passing_one_failing.feature:7:in `Given this step fails']]>
86
92
  </failure>
87
- <system-out/>
88
- <system-err/>
89
- </testcase>
90
93
  <system-out>
91
94
  <![CDATA[]]>
92
95
  </system-out>
93
96
  <system-err>
94
97
  <![CDATA[]]>
95
98
  </system-err>
99
+ </testcase>
96
100
  </testsuite>
97
101
 
98
102
  """
@@ -108,8 +112,12 @@ Feature: JUnit output formatter
108
112
  <?xml version="1.0" encoding="UTF-8"?>
109
113
  <testsuite failures="1" errors="0" skipped="0" tests="2" time="0.05" name="Subdirectory - One passing scenario, one failing scenario">
110
114
  <testcase classname="Subdirectory - One passing scenario, one failing scenario" name="Passing" time="0.05">
111
- <system-out/>
112
- <system-err/>
115
+ <system-out>
116
+ <![CDATA[]]>
117
+ </system-out>
118
+ <system-err>
119
+ <![CDATA[]]>
120
+ </system-err>
113
121
  </testcase>
114
122
  <testcase classname="Subdirectory - One passing scenario, one failing scenario" name="Failing" time="0.05">
115
123
  <failure message="failed Failing" type="failed">
@@ -123,15 +131,13 @@ Feature: JUnit output formatter
123
131
  ./features/step_definitions/steps.rb:4:in `/^this step fails$/'
124
132
  features/some_subdirectory/one_passing_one_failing.feature:7:in `Given this step fails']]>
125
133
  </failure>
126
- <system-out/>
127
- <system-err/>
128
- </testcase>
129
134
  <system-out>
130
135
  <![CDATA[]]>
131
136
  </system-out>
132
137
  <system-err>
133
138
  <![CDATA[]]>
134
139
  </system-err>
140
+ </testcase>
135
141
  </testsuite>
136
142
 
137
143
  """
@@ -148,20 +154,22 @@ Feature: JUnit output formatter
148
154
  <testsuite failures="0" errors="0" skipped="2" tests="2" time="0.05" name="Pending step">
149
155
  <testcase classname="Pending step" name="Pending" time="0.05">
150
156
  <skipped/>
151
- <system-out/>
152
- <system-err/>
157
+ <system-out>
158
+ <![CDATA[]]>
159
+ </system-out>
160
+ <system-err>
161
+ <![CDATA[]]>
162
+ </system-err>
153
163
  </testcase>
154
164
  <testcase classname="Pending step" name="Undefined" time="0.05">
155
165
  <skipped/>
156
- <system-out/>
157
- <system-err/>
158
- </testcase>
159
166
  <system-out>
160
167
  <![CDATA[]]>
161
168
  </system-out>
162
169
  <system-err>
163
170
  <![CDATA[]]>
164
171
  </system-err>
172
+ </testcase>
165
173
  </testsuite>
166
174
 
167
175
  """
@@ -188,8 +196,12 @@ Feature: JUnit output formatter
188
196
  ./features/step_definitions/steps.rb:3:in `/^this step is pending$/'
189
197
  features/pending.feature:4:in `Given this step is pending']]>
190
198
  </failure>
191
- <system-out/>
192
- <system-err/>
199
+ <system-out>
200
+ <![CDATA[]]>
201
+ </system-out>
202
+ <system-err>
203
+ <![CDATA[]]>
204
+ </system-err>
193
205
  </testcase>
194
206
  <testcase classname="Pending step" name="Undefined" time="0.05">
195
207
  <failure message="undefined Undefined" type="undefined">
@@ -199,18 +211,16 @@ Feature: JUnit output formatter
199
211
 
200
212
  Message:
201
213
  ]]>
202
- <![CDATA[Undefined step: "this step is undefined" (Cucumber::Undefined)
214
+ <![CDATA[Undefined step: "this step is undefined" (Cucumber::Core::Test::Result::Undefined)
203
215
  features/pending.feature:7:in `Given this step is undefined']]>
204
216
  </failure>
205
- <system-out/>
206
- <system-err/>
207
- </testcase>
208
217
  <system-out>
209
218
  <![CDATA[]]>
210
219
  </system-out>
211
220
  <system-err>
212
221
  <![CDATA[]]>
213
222
  </system-err>
223
+ </testcase>
214
224
  </testsuite>
215
225
 
216
226
  """
@@ -235,8 +245,8 @@ can't convert .* into String \(TypeError\)
235
245
  You *must* specify --out DIR for the junit formatter
236
246
  """
237
247
 
238
- Scenario: one feature, one scenario outline, two examples: one passing, one failing
239
- When I run `cucumber --format junit --out tmp/ features/scenario_outline.feature`
248
+ Scenario: strict mode, one feature, one scenario outline, four examples: one passing, one failing, one pending, one undefined
249
+ When I run `cucumber --strict --format junit --out tmp/ features/scenario_outline.feature`
240
250
  Then it should fail with:
241
251
  """
242
252
 
@@ -244,10 +254,14 @@ You *must* specify --out DIR for the junit formatter
244
254
  And the junit output file "tmp/TEST-features-scenario_outline.xml" should contain:
245
255
  """
246
256
  <?xml version="1.0" encoding="UTF-8"?>
247
- <testsuite failures="1" errors="0" skipped="0" tests="2" time="0.05" name="Scenario outlines">
257
+ <testsuite failures="3" errors="0" skipped="0" tests="4" time="0.05" name="Scenario outlines">
248
258
  <testcase classname="Scenario outlines" name="Using scenario outlines (outline example : | passes |)" time="0.05">
249
- <system-out/>
250
- <system-err/>
259
+ <system-out>
260
+ <![CDATA[]]>
261
+ </system-out>
262
+ <system-err>
263
+ <![CDATA[]]>
264
+ </system-err>
251
265
  </testcase>
252
266
  <testcase classname="Scenario outlines" name="Using scenario outlines (outline example : | fails |)" time="0.05">
253
267
  <failure message="failed Using scenario outlines (outline example : | fails |)" type="failed">
@@ -262,21 +276,58 @@ You *must* specify --out DIR for the junit formatter
262
276
  features/scenario_outline.feature:9:in `Given this step fails'
263
277
  features/scenario_outline.feature:4:in `Given this step <type>']]>
264
278
  </failure>
265
- <system-out/>
266
- <system-err/>
279
+ <system-out>
280
+ <![CDATA[]]>
281
+ </system-out>
282
+ <system-err>
283
+ <![CDATA[]]>
284
+ </system-err>
285
+ </testcase>
286
+ <testcase classname="Scenario outlines" name="Using scenario outlines (outline example : | is pending |)" time="0.05">
287
+ <failure message="pending Using scenario outlines (outline example : | is pending |)" type="pending">
288
+ <![CDATA[Scenario Outline: Using scenario outlines
289
+
290
+ Example row: | is pending |
291
+
292
+ Message:
293
+ ]]>
294
+ <![CDATA[TODO (Cucumber::Pending)
295
+ ./features/step_definitions/steps.rb:3:in `/^this step is pending$/'
296
+ features/scenario_outline.feature:10:in `Given this step is pending'
297
+ features/scenario_outline.feature:4:in `Given this step <type>']]>
298
+ </failure>
299
+ <system-out>
300
+ <![CDATA[]]>
301
+ </system-out>
302
+ <system-err>
303
+ <![CDATA[]]>
304
+ </system-err>
267
305
  </testcase>
306
+ <testcase classname="Scenario outlines" name="Using scenario outlines (outline example : | is undefined |)" time="0.05">
307
+ <failure message="undefined Using scenario outlines (outline example : | is undefined |)" type="undefined">
308
+ <![CDATA[Scenario Outline: Using scenario outlines
309
+
310
+ Example row: | is undefined |
311
+
312
+ Message:
313
+ ]]>
314
+ <![CDATA[Undefined step: "this step is undefined" (Cucumber::Core::Test::Result::Undefined)
315
+ features/scenario_outline.feature:11:in `Given this step is undefined'
316
+ features/scenario_outline.feature:4:in `Given this step <type>']]>
317
+ </failure>
268
318
  <system-out>
269
319
  <![CDATA[]]>
270
320
  </system-out>
271
321
  <system-err>
272
322
  <![CDATA[]]>
273
323
  </system-err>
324
+ </testcase>
274
325
  </testsuite>
275
326
 
276
327
  """
277
328
 
278
- Scenario: one feature, one scenario outline, two examples: one passing, one failing with --expand option
279
- When I run `cucumber --expand --format junit --out tmp/ features/scenario_outline.feature`
329
+ Scenario: strict mode with --expand option, one feature, one scenario outline, four examples: one passing, one failing, one pending, one undefined
330
+ When I run `cucumber --strict --expand --format junit --out tmp/ features/scenario_outline.feature`
280
331
  Then it should fail with exactly:
281
332
  """
282
333
 
@@ -284,10 +335,14 @@ You *must* specify --out DIR for the junit formatter
284
335
  And the junit output file "tmp/TEST-features-scenario_outline.xml" should contain:
285
336
  """
286
337
  <?xml version="1.0" encoding="UTF-8"?>
287
- <testsuite failures="1" errors="0" skipped="0" tests="2" time="0.05" name="Scenario outlines">
338
+ <testsuite failures="3" errors="0" skipped="0" tests="4" time="0.05" name="Scenario outlines">
288
339
  <testcase classname="Scenario outlines" name="Using scenario outlines (outline example : | passes |)" time="0.05">
289
- <system-out/>
290
- <system-err/>
340
+ <system-out>
341
+ <![CDATA[]]>
342
+ </system-out>
343
+ <system-err>
344
+ <![CDATA[]]>
345
+ </system-err>
291
346
  </testcase>
292
347
  <testcase classname="Scenario outlines" name="Using scenario outlines (outline example : | fails |)" time="0.05">
293
348
  <failure message="failed Using scenario outlines (outline example : | fails |)" type="failed">
@@ -302,15 +357,52 @@ You *must* specify --out DIR for the junit formatter
302
357
  features/scenario_outline.feature:9:in `Given this step fails'
303
358
  features/scenario_outline.feature:4:in `Given this step <type>']]>
304
359
  </failure>
305
- <system-out/>
306
- <system-err/>
360
+ <system-out>
361
+ <![CDATA[]]>
362
+ </system-out>
363
+ <system-err>
364
+ <![CDATA[]]>
365
+ </system-err>
366
+ </testcase>
367
+ <testcase classname="Scenario outlines" name="Using scenario outlines (outline example : | is pending |)" time="0.05">
368
+ <failure message="pending Using scenario outlines (outline example : | is pending |)" type="pending">
369
+ <![CDATA[Scenario Outline: Using scenario outlines
370
+
371
+ Example row: | is pending |
372
+
373
+ Message:
374
+ ]]>
375
+ <![CDATA[TODO (Cucumber::Pending)
376
+ ./features/step_definitions/steps.rb:3:in `/^this step is pending$/'
377
+ features/scenario_outline.feature:10:in `Given this step is pending'
378
+ features/scenario_outline.feature:4:in `Given this step <type>']]>
379
+ </failure>
380
+ <system-out>
381
+ <![CDATA[]]>
382
+ </system-out>
383
+ <system-err>
384
+ <![CDATA[]]>
385
+ </system-err>
307
386
  </testcase>
387
+ <testcase classname="Scenario outlines" name="Using scenario outlines (outline example : | is undefined |)" time="0.05">
388
+ <failure message="undefined Using scenario outlines (outline example : | is undefined |)" type="undefined">
389
+ <![CDATA[Scenario Outline: Using scenario outlines
390
+
391
+ Example row: | is undefined |
392
+
393
+ Message:
394
+ ]]>
395
+ <![CDATA[Undefined step: "this step is undefined" (Cucumber::Core::Test::Result::Undefined)
396
+ features/scenario_outline.feature:11:in `Given this step is undefined'
397
+ features/scenario_outline.feature:4:in `Given this step <type>']]>
398
+ </failure>
308
399
  <system-out>
309
400
  <![CDATA[]]>
310
401
  </system-out>
311
402
  <system-err>
312
403
  <![CDATA[]]>
313
404
  </system-err>
405
+ </testcase>
314
406
  </testsuite>
315
407
 
316
408
  """