cucumber/cucumber — Issue #173: Running a specific example line actually runs the whole file
Author: jmerrifield
Created: 2011-11-14 14:21:09+00:00
State: open

If I have the following feature file:

````
Feature: Some feature

Scenario: Scenario 1
Given some condition

Scenario Outline: Scenario 2
Given some condition
When I go to
Then some assertion
Examples:
| page |
| /home |
| /profile |
| /logout |

Scenario: Scenario 3
Given some condition

Scenario: Scenario 4
Given some condition
````

And I try to run just the second example of 'Scenario 2', Cucumber actually runs that example, *and* every other scenario until EOF:

````
$ cucumber features/test.feature:13

Feature: Some feature

Scenario Outline: Scenario 2 # features/test.feature:6
Given some condition # features/test.feature:7
When I go to # features/test.feature:8
Then some assertion # features/test.feature:9

Examples:
| page |
| /profile |

Scenario: Scenario 3 # features/test.feature:16
Given some condition # features/test.feature:17

Scenario: Scenario 4 # features/test.feature:19
Given some condition # features/test.feature:20

3 scenarios (3 undefined)
5 steps (5 undefined)
0m0.003s
````

Even worse, if I try and run 2 rows of that example table by passing in a text file (rerun.txt):

````
features/test.feature:12
features/test.feature:14
````

Then cucumber runs the correct 2 rows of the example, *and* every other scenario until EOF, *twice*:

````
$ cucumber @rerun.txt

Feature: Some feature

Scenario Outline: Scenario 2 # features/test.feature:6
Given some condition # features/test.feature:7
When I go to # features/test.feature:8
Then some assertion # features/test.feature:9

Examples:
| page |
| /home |

Scenario: Scenario 3 # features/test.feature:16
Given some condition # features/test.feature:17

Scenario: Scenario 4 # features/test.feature:19
Given some condition # features/test.feature:20

Feature: Some feature

Scenario Outline: Scenario 2 # features/test.feature:6
Given some condition # features/test.feature:7
When I go to # features/test.feature:8
Then some assertion # features/test.feature:9

Examples:
| page |
| /logout |

Scenario: Scenario 3 # features/test.feature:16
Given some condition # features/test.feature:17

Scenario: Scenario 4 # features/test.feature:19
Given some condition # features/test.feature:20

6 scenarios (6 undefined)
10 steps (10 undefined)
0m0.017s

````