cucumber 0.8.5 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. data/.rspec +1 -1
  2. data/LICENSE +1 -1
  3. data/Rakefile +5 -51
  4. data/bin/cucumber +7 -1
  5. data/cucumber.gemspec +463 -679
  6. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -1
  7. data/examples/i18n/he/features/step_definitons/calculator_steps.rb +1 -1
  8. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +4 -7
  9. data/examples/i18n/ru/features/division.feature +2 -2
  10. data/examples/i18n/tr/features/step_definitons/hesap_makinesi_adimlari.rb +3 -3
  11. data/examples/sinatra/features/support/env.rb +2 -5
  12. data/examples/v8/features/fibonacci.feature +1 -1
  13. data/examples/watir/features/step_definitions/search_steps.rb +1 -1
  14. data/features/background.feature +284 -95
  15. data/features/custom_formatter.feature +3 -73
  16. data/features/json_formatter.feature +160 -245
  17. data/features/step_definitions/cucumber_steps.rb +7 -153
  18. data/features/support/env.rb +18 -140
  19. data/fixtures/junit/features/pending.feature +3 -1
  20. data/fixtures/self_test/features/support/env.rb +8 -0
  21. data/fixtures/tickets/features.html +1 -1
  22. data/gem_tasks/examples.rake +1 -1
  23. data/lib/cucumber.rb +12 -0
  24. data/lib/cucumber/ast.rb +1 -1
  25. data/lib/cucumber/ast/background.rb +21 -5
  26. data/lib/cucumber/ast/examples.rb +12 -4
  27. data/lib/cucumber/ast/feature.rb +13 -5
  28. data/lib/cucumber/ast/feature_element.rb +9 -4
  29. data/lib/cucumber/ast/outline_table.rb +4 -4
  30. data/lib/cucumber/ast/scenario.rb +7 -5
  31. data/lib/cucumber/ast/scenario_outline.rb +23 -15
  32. data/lib/cucumber/ast/step.rb +5 -0
  33. data/lib/cucumber/ast/step_invocation.rb +21 -15
  34. data/lib/cucumber/ast/table.rb +14 -8
  35. data/lib/cucumber/ast/tree_walker.rb +10 -48
  36. data/lib/cucumber/cli/configuration.rb +33 -8
  37. data/lib/cucumber/cli/main.rb +20 -35
  38. data/lib/cucumber/cli/options.rb +8 -7
  39. data/lib/cucumber/cli/profile_loader.rb +2 -0
  40. data/lib/cucumber/core_ext/proc.rb +2 -1
  41. data/lib/cucumber/feature_file.rb +47 -15
  42. data/lib/cucumber/formatter/ansicolor.rb +3 -5
  43. data/lib/cucumber/formatter/console.rb +27 -23
  44. data/lib/cucumber/formatter/cucumber.css +34 -17
  45. data/lib/cucumber/formatter/cucumber.sass +173 -182
  46. data/lib/cucumber/formatter/html.rb +46 -11
  47. data/lib/cucumber/formatter/io.rb +2 -4
  48. data/lib/cucumber/formatter/json.rb +15 -152
  49. data/lib/cucumber/formatter/json_pretty.rb +5 -6
  50. data/lib/cucumber/formatter/junit.rb +28 -22
  51. data/lib/cucumber/formatter/pdf.rb +6 -6
  52. data/lib/cucumber/formatter/pretty.rb +5 -5
  53. data/lib/cucumber/formatter/rerun.rb +22 -11
  54. data/lib/cucumber/formatter/unicode.rb +41 -20
  55. data/lib/cucumber/js_support/js_dsl.js +4 -4
  56. data/lib/cucumber/js_support/js_language.rb +9 -5
  57. data/lib/cucumber/js_support/js_snippets.rb +2 -2
  58. data/lib/cucumber/language_support.rb +2 -2
  59. data/lib/cucumber/parser/gherkin_builder.rb +35 -30
  60. data/lib/cucumber/platform.rb +8 -8
  61. data/lib/cucumber/py_support/py_language.rb +2 -2
  62. data/lib/cucumber/rake/task.rb +80 -31
  63. data/lib/cucumber/rb_support/rb_dsl.rb +1 -0
  64. data/lib/cucumber/rb_support/rb_language.rb +10 -8
  65. data/lib/cucumber/rb_support/rb_step_definition.rb +8 -0
  66. data/lib/cucumber/rb_support/rb_transform.rb +17 -0
  67. data/lib/cucumber/rb_support/rb_world.rb +26 -18
  68. data/lib/cucumber/rspec/doubles.rb +3 -3
  69. data/lib/cucumber/step_match.rb +6 -2
  70. data/lib/cucumber/step_mother.rb +6 -427
  71. data/lib/cucumber/wire_support/configuration.rb +4 -1
  72. data/lib/cucumber/wire_support/wire_language.rb +3 -10
  73. data/spec/cucumber/ast/background_spec.rb +68 -6
  74. data/spec/cucumber/ast/feature_factory.rb +5 -4
  75. data/spec/cucumber/ast/feature_spec.rb +4 -4
  76. data/spec/cucumber/ast/outline_table_spec.rb +1 -1
  77. data/spec/cucumber/ast/scenario_outline_spec.rb +15 -11
  78. data/spec/cucumber/ast/scenario_spec.rb +4 -4
  79. data/spec/cucumber/ast/step_spec.rb +3 -3
  80. data/spec/cucumber/ast/table_spec.rb +38 -2
  81. data/spec/cucumber/ast/tree_walker_spec.rb +2 -2
  82. data/spec/cucumber/broadcaster_spec.rb +1 -1
  83. data/spec/cucumber/cli/configuration_spec.rb +32 -6
  84. data/spec/cucumber/cli/drb_client_spec.rb +2 -3
  85. data/spec/cucumber/cli/main_spec.rb +43 -43
  86. data/spec/cucumber/cli/options_spec.rb +28 -1
  87. data/spec/cucumber/cli/profile_loader_spec.rb +1 -1
  88. data/spec/cucumber/core_ext/proc_spec.rb +1 -1
  89. data/spec/cucumber/formatter/ansicolor_spec.rb +1 -1
  90. data/spec/cucumber/formatter/duration_spec.rb +1 -1
  91. data/spec/cucumber/formatter/html_spec.rb +3 -5
  92. data/spec/cucumber/formatter/junit_spec.rb +16 -2
  93. data/spec/cucumber/formatter/progress_spec.rb +1 -1
  94. data/spec/cucumber/formatter/spec_helper.rb +11 -12
  95. data/spec/cucumber/rb_support/rb_language_spec.rb +241 -28
  96. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +33 -28
  97. data/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb +1 -1
  98. data/spec/cucumber/step_match_spec.rb +11 -9
  99. data/spec/cucumber/wire_support/configuration_spec.rb +1 -1
  100. data/spec/cucumber/wire_support/connection_spec.rb +1 -1
  101. data/spec/cucumber/wire_support/wire_exception_spec.rb +1 -1
  102. data/spec/cucumber/wire_support/wire_language_spec.rb +1 -1
  103. data/spec/cucumber/wire_support/wire_packet_spec.rb +1 -1
  104. data/spec/cucumber/wire_support/wire_step_definition_spec.rb +1 -1
  105. data/spec/cucumber/world/pending_spec.rb +2 -2
  106. data/spec/spec_helper.rb +13 -20
  107. metadata +11 -222
  108. data/.gitignore +0 -20
  109. data/Caliper.yml +0 -4
  110. data/History.txt +0 -1552
  111. data/README.rdoc +0 -26
  112. data/VERSION.yml +0 -5
  113. data/examples/i18n/ro/features/suma.feature +0 -11
  114. data/features/announce.feature +0 -164
  115. data/features/around_hooks.feature +0 -232
  116. data/features/bug_371.feature +0 -32
  117. data/features/bug_464.feature +0 -16
  118. data/features/bug_475.feature +0 -42
  119. data/features/bug_585_tab_indentation.feature +0 -22
  120. data/features/bug_600.feature +0 -67
  121. data/features/call_steps_from_stepdefs.feature +0 -154
  122. data/features/cucumber_cli.feature +0 -591
  123. data/features/cucumber_cli_outlines.feature +0 -117
  124. data/features/default_snippets.feature +0 -42
  125. data/features/diffing.feature +0 -25
  126. data/features/drb_server_integration.feature +0 -174
  127. data/features/exception_in_after_block.feature +0 -127
  128. data/features/exception_in_after_step_block.feature +0 -104
  129. data/features/exception_in_before_block.feature +0 -98
  130. data/features/exclude_files.feature +0 -20
  131. data/features/expand.feature +0 -60
  132. data/features/html_formatter.feature +0 -8
  133. data/features/html_formatter/a.html +0 -582
  134. data/features/junit_formatter.feature +0 -88
  135. data/features/language_from_header.feature +0 -30
  136. data/features/language_help.feature +0 -78
  137. data/features/listener_debugger_formatter.feature +0 -42
  138. data/features/multiline_names.feature +0 -44
  139. data/features/negative_tagged_hooks.feature +0 -60
  140. data/features/post_configuration_hook.feature +0 -37
  141. data/features/profiles.feature +0 -126
  142. data/features/rake_task.feature +0 -152
  143. data/features/report_called_undefined_steps.feature +0 -34
  144. data/features/rerun_formatter.feature +0 -45
  145. data/features/simplest.feature +0 -11
  146. data/features/snippet.feature +0 -23
  147. data/features/snippets_when_using_star_keyword.feature +0 -36
  148. data/features/step_definitions/extra_steps.rb +0 -2
  149. data/features/step_definitions/simplest_steps.rb +0 -3
  150. data/features/step_definitions/wire_steps.rb +0 -32
  151. data/features/support/env.rb.simplest +0 -7
  152. data/features/support/fake_wire_server.rb +0 -77
  153. data/features/table_diffing.feature +0 -45
  154. data/features/table_mapping.feature +0 -34
  155. data/features/tag_logic.feature +0 -258
  156. data/features/transform.feature +0 -245
  157. data/features/unicode_table.feature +0 -35
  158. data/features/usage_and_stepdefs_formatter.feature +0 -169
  159. data/features/wire_protocol.feature +0 -332
  160. data/features/wire_protocol_table_diffing.feature +0 -119
  161. data/features/wire_protocol_tags.feature +0 -87
  162. data/features/wire_protocol_timeouts.feature +0 -63
  163. data/features/work_in_progress.feature +0 -156
  164. data/fixtures/json/features/pystring.feature +0 -8
  165. data/fixtures/self_test/features/background/background_tagged_before_on_outline.feature +0 -12
  166. data/fixtures/self_test/features/background/background_with_name.feature +0 -7
  167. data/fixtures/self_test/features/background/failing_background.feature +0 -12
  168. data/fixtures/self_test/features/background/failing_background_after_success.feature +0 -11
  169. data/fixtures/self_test/features/background/multiline_args_background.feature +0 -32
  170. data/fixtures/self_test/features/background/passing_background.feature +0 -10
  171. data/fixtures/self_test/features/background/pending_background.feature +0 -10
  172. data/fixtures/self_test/features/background/scenario_outline_failing_background.feature +0 -16
  173. data/fixtures/self_test/features/background/scenario_outline_passing_background.feature +0 -16
  174. data/gem_tasks/features.rake +0 -14
  175. data/gem_tasks/sdoc.rake +0 -12
  176. data/lib/cucumber/ast/py_string.rb +0 -80
  177. data/lib/cucumber/formatter/color_io.rb +0 -23
  178. data/lib/cucumber/formatter/tag_cloud.rb +0 -35
  179. data/spec/cucumber/ast/py_string_spec.rb +0 -40
  180. data/spec/cucumber/formatter/color_io_spec.rb +0 -29
  181. data/spec/cucumber/step_mother_spec.rb +0 -302
@@ -1,18 +1,7 @@
1
1
  Feature: Custom Formatter
2
2
 
3
- Scenario: count tags
4
- When I run cucumber --format Cucumber::Formatter::TagCloud features
5
- Then STDERR should be empty
6
- Then it should fail with
7
- """
8
- | @after_file | @background_tagged_before_on_outline | @four | @lots | @one | @sample_four | @sample_one | @sample_three | @sample_two | @three | @two |
9
- | 1 | 1 | 1 | 1 | 1 | 2 | 1 | 2 | 1 | 2 | 1 |
10
-
11
- """
12
-
13
3
  Scenario: my own formatter
14
- Given a standard Cucumber project directory structure
15
- And a file named "features/f.feature" with:
4
+ Given a file named "features/f.feature" with:
16
5
  """
17
6
  Feature: I'll use my own
18
7
  because I'm worth it
@@ -43,69 +32,10 @@ Feature: Custom Formatter
43
32
  end
44
33
  end
45
34
  """
46
- When I run cucumber features/f.feature --format Ze::Formator
47
- Then STDERR should be empty
48
- Then it should pass with
35
+ When I run cucumber "features/f.feature --format Ze::Formator"
36
+ Then it should pass with exactly:
49
37
  """
50
38
  I'LL USE MY OWN
51
39
  JUST PRINT ME
52
40
 
53
41
  """
54
-
55
- Scenario: Legacy pre-0.7.0 formatter
56
- Given a standard Cucumber project directory structure
57
- And a file named "features/f.feature" with:
58
- """
59
- Feature: We like old cukes
60
- Scenario Outline: just print me
61
- Given this step works
62
-
63
- Examples: print me too
64
- |foo|
65
- |bar|
66
- """
67
- And a file named "features/step_definitions/steps.rb" with:
68
- """
69
- Given /^this step works$/ do
70
- end
71
- """
72
- And a file named "features/support/legacy/formator.rb" with:
73
- """
74
- module Legacy
75
- class Formator
76
- def initialize(step_mother, io, options)
77
- @io = io
78
- end
79
-
80
- def feature_name(name)
81
- @io.puts name
82
- end
83
-
84
- def scenario_name(keyword, name, file_colon_line, source_indent)
85
- @io.puts "#{keyword} #{name}"
86
- end
87
-
88
- def examples_name(keyword, name)
89
- @io.puts "#{keyword} #{name}"
90
- end
91
- end
92
- end
93
- """
94
- When I run cucumber features/f.feature --format Legacy::Formator
95
- Then STDERR should be
96
- """
97
- Legacy::Formator is using a deprecated formatter API. Starting with Cucumber 0.7.0 the signatures
98
- that have changed are:
99
- feature_name(keyword, name) # Two arguments. The keyword argument will not contain a colon.
100
- scenario_name(keyword, name, file_colon_line, source_indent) # The keyword argument will not contain a colon.
101
- examples_name(keyword, name) # The keyword argument will not contain a colon.
102
-
103
-
104
- """
105
- Then it should pass with
106
- """
107
- Feature: We like old cukes
108
- Scenario Outline: just print me
109
- Examples: print me too
110
-
111
- """
@@ -1,225 +1,198 @@
1
1
  Feature: JSON output formatter
2
- In order to get results as data
3
- As a developer
4
- Cucumber should be able to output JSON
2
+ In order to simplify processing of Cucumber features and results
3
+ Developers should be able to consume features as JSON
5
4
 
6
5
  Background:
7
- Given I am in json
6
+ Given a file named "features/one_passing_one_failing.feature" with:
7
+ """
8
+ @a
9
+ Feature: One passing scenario, one failing scenario
8
10
 
9
- Scenario: one feature, one passing scenario, one failing scenario
10
- And the tmp directory is empty
11
- When I run cucumber --format json --out tmp/out.json features/one_passing_one_failing.feature
12
- Then STDERR should be empty
13
- And it should fail with
11
+ @b
12
+ Scenario: Passing
13
+ Given a passing step
14
+
15
+ @c
16
+ Scenario: Failing
17
+ Given a failing step
18
+ """
19
+ And a file named "features/step_definitions/steps.rb" with:
20
+ """
21
+ Given /a passing step/ do
22
+ #does nothing
23
+ end
24
+
25
+ Given /a failing step/ do
26
+ fail
27
+ end
28
+
29
+ Given /a pending step/ do
30
+ pending
31
+ end
32
+
33
+ Given /^I add (\d+) and (\d+)$/ do |a,b|
34
+ @result = a.to_i + b.to_i
35
+ end
36
+
37
+ Then /^I the result should be (\d+)$/ do |c|
38
+ @result.should == c.to_i
39
+ end
40
+
41
+ Then /^I should see/ do |string|
42
+
43
+ end
44
+
45
+ Given /^I pass a table argument/ do |table|
46
+
47
+ end
48
+
49
+ Given /^I embed a screenshot/ do
50
+ File.open("screenshot.png", "w") { |file| file << "foo" }
51
+ embed "screenshot.png", "image/png"
52
+ end
14
53
  """
54
+ And a file named "features/embed.feature" with:
15
55
  """
16
- And "fixtures/json/tmp/out.json" should match "^\{\"features\":\["
56
+ Feature: A screenshot feature
57
+
58
+ Scenario:
59
+ Given I embed a screenshot
60
+
61
+ """
62
+
63
+ Scenario: one feature, one passing scenario, one failing scenario
64
+ When I run cucumber "--format json features/one_passing_one_failing.feature"
65
+ Then the output should match /^\{"features":\[/
17
66
 
18
67
  Scenario: one feature, one passing scenario, one failing scenario
19
- When I run cucumber --format json_pretty features/one_passing_one_failing.feature
20
- Then STDERR should be empty
21
- And it should fail with JSON
68
+ When I run cucumber "--format json features/one_passing_one_failing.feature"
69
+ Then it should fail with JSON:
22
70
  """
23
71
  {
24
72
  "features": [
25
73
  {
26
- "file": "features/one_passing_one_failing.feature",
74
+ "keyword": "Feature",
27
75
  "name": "One passing scenario, one failing scenario",
76
+ "line": 2,
77
+ "description": "",
28
78
  "tags": [
29
- "@a"
79
+ {
80
+ "name": "@a",
81
+ "line": 1
82
+ }
30
83
  ],
31
84
  "elements": [
32
85
  {
33
- "tags": [
34
- "@b"
35
- ],
36
86
  "keyword": "Scenario",
37
87
  "name": "Passing",
38
- "file_colon_line": "features/one_passing_one_failing.feature:5",
88
+ "line": 5,
89
+ "description": "",
90
+ "tags": [
91
+ {
92
+ "name": "@b",
93
+ "line": 4
94
+ }
95
+ ],
96
+ "type": "scenario",
39
97
  "steps": [
40
98
  {
41
- "status": "passed",
42
99
  "keyword": "Given ",
43
100
  "name": "a passing step",
44
- "file_colon_line": "features/step_definitions/steps.rb:1"
101
+ "line": 6,
102
+ "match": {
103
+ "location": "features/step_definitions/steps.rb:1"
104
+ },
105
+ "result": {
106
+ "status": "passed"
107
+ }
45
108
  }
46
109
  ]
47
110
  },
48
111
  {
49
- "tags": [
50
- "@c"
51
- ],
52
112
  "keyword": "Scenario",
53
113
  "name": "Failing",
54
- "file_colon_line": "features/one_passing_one_failing.feature:9",
55
- "steps": [
114
+ "line": 9,
115
+ "description": "",
116
+ "tags": [
56
117
  {
57
- "exception": {
58
- "class": "RuntimeError",
59
- "message": "",
60
- "backtrace": [
61
- "./features/step_definitions/steps.rb:6:in `/a failing step/'",
62
- "features/one_passing_one_failing.feature:10:in `Given a failing step'"
63
- ]
64
- },
65
- "status": "failed",
66
- "keyword": "Given ",
67
- "name": "a failing step",
68
- "file_colon_line": "features/step_definitions/steps.rb:5"
118
+ "name": "@c",
119
+ "line": 8
69
120
  }
70
- ]
71
- }
72
- ]
73
- }
74
- ]
75
- }
76
- """
77
-
78
- Scenario: Tables
79
- When I run cucumber --format json_pretty features/tables.feature
80
- Then STDERR should be empty
81
- And it should fail with JSON
82
- """
83
- {
84
- "features": [
85
- {
86
- "file": "features/tables.feature",
87
- "name": "A scenario outline",
88
- "tags": [
89
-
90
- ],
91
- "elements": [
92
- {
93
- "tags": [
94
-
95
121
  ],
96
- "keyword": "Scenario Outline",
97
- "name": "",
98
- "file_colon_line": "features/tables.feature:3",
122
+ "type": "scenario",
99
123
  "steps": [
100
124
  {
101
- "status": "skipped",
102
125
  "keyword": "Given ",
103
- "name": "I add <a> and <b>",
104
- "file_colon_line": "features/step_definitions/steps.rb:13"
105
- },
106
- {
107
- "status": "skipped",
108
- "keyword": "When ",
109
- "name": "I pass a table argument",
110
- "file_colon_line": "features/step_definitions/steps.rb:25",
111
- "table": [
112
- {"cells":
113
- [{"text":"foo", "status": null},
114
- {"text":"bar", "status": null}]},
115
- {"cells":
116
- [{"text": "bar", "status": null},
117
- {"text": "baz", "status": null}]}
118
- ]
119
- },
120
- {
121
- "status": "skipped",
122
- "keyword": "Then ",
123
- "name": "I the result should be <c>",
124
- "file_colon_line": "features/step_definitions/steps.rb:17"
125
- }
126
- ],
127
- "examples": {
128
- "name": "Examples ",
129
- "table": [
130
- {
131
- "cells": [
132
- {
133
- "text": "a",
134
- "status": "skipped_param"
135
- },
136
- {
137
- "text": "b",
138
- "status": "skipped_param"
139
- },
140
- {
141
- "text": "c",
142
- "status": "skipped_param"
143
- }
144
- ]
145
- },
146
- {
147
- "cells": [
148
- {
149
- "text": "1",
150
- "status": "passed"
151
- },
152
- {
153
- "text": "2",
154
- "status": "passed"
155
- },
156
- {
157
- "text": "3",
158
- "status": "passed"
159
- }
160
- ]
126
+ "name": "a failing step",
127
+ "line": 10,
128
+ "match": {
129
+ "location": "features/step_definitions/steps.rb:5"
161
130
  },
162
- {
163
- "cells": [
164
- {
165
- "text": "2",
166
- "status": "passed"
167
- },
168
- {
169
- "text": "3",
170
- "status": "passed"
171
- },
172
- {
173
- "text": "4",
174
- "status": "failed"
175
- }
176
- ],
177
- "exception": {
178
- "class": "RSpec::Expectations::ExpectationNotMetError",
179
- "message": "expected: 4,\n got: 5 (using ==)\nDiff:\n@@ -1,2 +1,2 @@\n-4\n+5\n",
180
- "backtrace": [
181
- "./features/step_definitions/steps.rb:18:in `/^I the result should be (\\d+)$/'",
182
- "features/tables.feature:8:in `Then I the result should be <c>'"
183
- ]
184
- }
131
+ "result": {
132
+ "status": "failed",
133
+ "error_message": " (RuntimeError)\n./features/step_definitions/steps.rb:6:in `/a failing step/'\nfeatures/one_passing_one_failing.feature:10:in `Given a failing step'"
185
134
  }
186
- ]
187
- }
135
+ }
136
+ ]
188
137
  }
189
138
  ]
190
139
  }
191
140
  ]
192
141
  }
142
+
193
143
  """
194
144
 
195
145
  Scenario: pystring
196
- When I run cucumber --format json_pretty features/pystring.feature
197
- Then STDERR should be empty
198
- And it should pass with JSON
199
- """
146
+ Given a file named "features/pystring.feature" with:
147
+ """
148
+ Feature: A pystring feature
149
+
150
+ Scenario:
151
+ Then I should fail with
152
+ \"\"\"
153
+ a string
154
+ \"\"\"
155
+ """
156
+ And a file named "features/step_definitions/pystring_steps.rb" with:
157
+ """
158
+ Then /I should fail with/ do |s|
159
+ raise s
160
+ end
161
+ """
162
+ When I run cucumber "--format json features/pystring.feature"
163
+ Then it should fail with JSON:
164
+ """
200
165
  {
201
166
  "features": [
202
167
  {
203
- "file": "features/pystring.feature",
204
- "name": "A py string feature",
205
- "tags": [
206
-
207
- ],
168
+ "keyword": "Feature",
169
+ "name": "A pystring feature",
170
+ "line": 1,
171
+ "description": "",
208
172
  "elements": [
209
173
  {
210
- "tags": [
211
-
212
- ],
213
174
  "keyword": "Scenario",
214
175
  "name": "",
215
- "file_colon_line": "features/pystring.feature:3",
176
+ "line": 3,
177
+ "description": "",
178
+ "type": "scenario",
216
179
  "steps": [
217
180
  {
218
- "status": "passed",
219
181
  "keyword": "Then ",
220
- "name": "I should see",
221
- "file_colon_line": "features/step_definitions/steps.rb:21",
222
- "py_string": "a string"
182
+ "name": "I should fail with",
183
+ "line": 4,
184
+ "multiline_arg": {
185
+ "value": "a string",
186
+ "line": 5,
187
+ "type": "doc_string"
188
+ },
189
+ "match": {
190
+ "location": "features/step_definitions/pystring_steps.rb:1"
191
+ },
192
+ "result": {
193
+ "status": "failed",
194
+ "error_message": "a string (RuntimeError)\n./features/step_definitions/pystring_steps.rb:2:in `/I should fail with/'\nfeatures/pystring.feature:4:in `Then I should fail with'"
195
+ }
223
196
  }
224
197
  ]
225
198
  }
@@ -227,102 +200,43 @@ Feature: JSON output formatter
227
200
  }
228
201
  ]
229
202
  }
230
- """
231
-
232
- Scenario: background
233
- When I run cucumber --format json_pretty features/background.feature
234
- Then STDERR should be empty
235
- And it should fail with JSON
236
- """
237
- {
238
- "features": [
239
- {
240
- "file": "features/background.feature",
241
- "name": "Feature with background",
242
- "tags": [
243
-
244
- ],
245
- "background": {
246
- "steps": [
247
- {
248
- "status": "passed",
249
- "keyword": "Given ",
250
- "name": "a passing step",
251
- "file_colon_line": "features/step_definitions/steps.rb:1"
252
- }
253
- ]
254
- },
255
- "elements": [
256
- {
257
- "tags": [
258
-
259
- ],
260
- "keyword": "Scenario",
261
- "name": "",
262
- "file_colon_line": "features/background.feature:6",
263
- "steps": [
264
- {
265
- "status": "passed",
266
- "keyword": "Given ",
267
- "name": "a passing step",
268
- "file_colon_line": "features/step_definitions/steps.rb:1"
269
- },
270
- {
271
- "exception": {
272
- "class": "RuntimeError",
273
- "message": "",
274
- "backtrace": [
275
- "./features/step_definitions/steps.rb:6:in `/a failing step/'",
276
- "features/background.feature:7:in `Given a failing step'"
277
- ]
278
- },
279
- "status": "failed",
280
- "keyword": "Given ",
281
- "name": "a failing step",
282
- "file_colon_line": "features/step_definitions/steps.rb:5"
283
- }
284
- ]
285
- }
286
- ]
287
- }
288
- ]
289
- }
290
- """
203
+ """
291
204
 
292
205
  Scenario: embedding screenshot
293
- When I run cucumber --format json_pretty features/embed.feature
294
- Then STDERR should be empty
295
- And it should pass with JSON
206
+ When I run cucumber "-b --format json features/embed.feature"
207
+ Then it should pass with JSON:
296
208
  """
297
209
  {
298
210
  "features": [
299
211
  {
300
- "file": "features/embed.feature",
212
+ "keyword": "Feature",
301
213
  "name": "A screenshot feature",
302
- "tags": [
303
-
304
- ],
214
+ "line": 1,
215
+ "description": "",
305
216
  "elements": [
306
217
  {
307
- "tags": [
308
-
309
- ],
310
218
  "keyword": "Scenario",
311
219
  "name": "",
312
- "file_colon_line": "features/embed.feature:3",
220
+ "line": 3,
221
+ "description": "",
222
+ "type": "scenario",
313
223
  "steps": [
314
224
  {
315
- "status": "passed",
316
225
  "keyword": "Given ",
317
226
  "name": "I embed a screenshot",
318
- "file_colon_line": "features/step_definitions/steps.rb:29",
319
- "embedded": [
227
+ "line": 4,
228
+ "embeddings": [
320
229
  {
321
- "file": "tmp/screenshot.png",
322
230
  "mime_type": "image/png",
323
- "data": "Zm9v\n"
231
+ "data": "Zm9v"
324
232
  }
325
- ]
233
+ ],
234
+ "match": {
235
+ "location": "features/step_definitions/steps.rb:29"
236
+ },
237
+ "result": {
238
+ "status": "passed"
239
+ }
326
240
  }
327
241
  ]
328
242
  }
@@ -330,4 +244,5 @@ Feature: JSON output formatter
330
244
  }
331
245
  ]
332
246
  }
247
+
333
248
  """