Skip to content

Commit

Permalink
Clean up the JSON formatter feature.
Browse files Browse the repository at this point in the history
Remove duplicate scenarios and add @wip-new-core to the outline expand
scenario moved from the v1.3.x branch.
  • Loading branch information
brasmusson committed Aug 6, 2014
1 parent 3bc8d70 commit 0b562e6
Showing 1 changed file with 1 addition and 167 deletions.
168 changes: 1 addition & 167 deletions features/docs/formatters/json_formatter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,6 @@ Feature: JSON output formatter
And I print from step definition
"""
And a file named "features/outline.feature" with:
"""
Feature: An outline feature
Scenario Outline: outline
Given a <type> step
Examples: examples1
| type |
| passing |
| failing |
Examples: examples2
| type |
| passing |
"""

# Need to investigate why this won't pass in-process. error_message doesn't get det?
@spawn
Expand Down Expand Up @@ -516,156 +499,7 @@ Feature: JSON output formatter
]
"""
Scenario: print from step definition
When I run `cucumber --format json features/print_from_step_definition.feature`
Then it should pass with JSON:
"""
[
{
"uri": "features/print_from_step_definition.feature",
"id": "a-print-from-step-definition-feature",
"keyword": "Feature",
"name": "A print from step definition feature",
"line": 1,
"description": "",
"elements": [
{
"id": "a-print-from-step-definition-feature;",
"keyword": "Scenario",
"name": "",
"line": 3,
"description": "",
"type": "scenario",
"steps": [
{
"keyword": "Given ",
"name": "I print from step definition",
"line": 4,
"output": [
"from step definition"
],
"match": {
"location": "features/step_definitions/json_steps.rb:6"
},
"result": {
"status": "passed",
"duration": 1
}
},
{
"keyword": "And ",
"name": "I print from step definition",
"line": 5,
"output": [
"from step definition"
],
"match": {
"location": "features/step_definitions/json_steps.rb:6"
},
"result": {
"status": "passed",
"duration": 1
}
}
]
}
]
}
]
"""
@spawn
Scenario: scenario outline
When I run `cucumber --format json features/outline.feature`
Then it should fail with JSON:
"""
[
{
"uri": "features/outline.feature",
"id": "an-outline-feature",
"keyword": "Feature",
"name": "An outline feature",
"line": 1,
"description": "",
"elements": [
{
"id": "an-outline-feature;outline",
"keyword": "Scenario Outline",
"name": "outline",
"line": 3,
"description": "",
"type": "scenario_outline",
"steps": [
{
"keyword": "Given ",
"name": "a <type> step",
"line": 4,
"match": {
"location": "features/step_definitions/steps.rb:1"
}
}
],
"examples": [
{
"keyword": "Examples",
"name": "examples1",
"line": 6,
"description": "",
"id": "an-outline-feature;outline;examples1",
"rows": [
{
"cells": [
"type"
],
"line": 7,
"id": "an-outline-feature;outline;examples1;1"
},
{
"cells": [
"passing"
],
"line": 8,
"id": "an-outline-feature;outline;examples1;2"
},
{
"cells": [
"failing"
],
"line": 9,
"id": "an-outline-feature;outline;examples1;3"
}
]
},
{
"keyword": "Examples",
"name": "examples2",
"line": 11,
"description": "",
"id": "an-outline-feature;outline;examples2",
"rows": [
{
"cells": [
"type"
],
"line": 12,
"id": "an-outline-feature;outline;examples2;1"
},
{
"cells": [
"passing"
],
"line": 13,
"id": "an-outline-feature;outline;examples2;2"
}
]
}
]
}
]
}
]
"""
@wip-new-core
@spawn
Scenario: scenario outline expanded
When I run `cucumber --expand --format json features/outline.feature`
Expand Down

2 comments on commit 0b562e6

@brasmusson
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattwynne I see that you basically merged #700 also into v2.0. Since the --expand option is not implemented fully in v2.0 (see formatter_callbacks.feature), the "scenario outline expanded" scenario need to be @wip-new-core. Some scenarios for the JSON formatter I have provided in both v1.3.x and v2.0, so with merges they have become duplicated in the v2.0 feature.

@mattwynne
Copy link
Member

@mattwynne mattwynne commented on 0b562e6 Aug 7, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.