cucumber/cucumber-jvm — Issue #170: Scenario Outlines failing
Author: dkowis
Created: 2012-01-24 04:19:10+00:00
State: open

Problem: Scenario Outline Examples are not being properly substituted into the scenario Outline when being run. Only happens when being run by the CLI, not when running via JUnit.

I found the problem: It's in commit 41493c8c8b84b1e3667c1fbd732c5edba83510e9 that is mentioned to close #146

The solution to my problem that gets the Scenario Outlines working again when run by the CLI.

Replace:

```java
stepRunner.runSteps(reporter, runtime);
```

with:

```java
runSteps(reporter,runtime);
```

Unfortunately, I couldn't quite figure out what was wrong with #146 and we don't have a test in the spring backend to verify it, so I'm not exactly sure how to proceed with this. I know that commit breaks a Scenario Outline written using the JRuby Backend. I suspect that it is not JRubyBackend specific, since the commit touches Core and JUnit

Not using the stepRunner in this specific case has the stepRunner only being used by the JUnit backend, not the ScenarioOutline, nor the Scenario.

Test Code: I dropped this into the jruby backend's testing directory (so it'd get executed, and git wouldn't bother with it,) and started a git bisect at v1.0.0.RC11 (which was good) with HEAD being bad. I ended up at 41493c8c8b84b1e3667c1fbd732c5edba83510e9

Feature File:

```
Feature: EPIC FAIL

Scenario Outline: Do a scenario outline calling things
Given I store the value ""
When I grab another value ""
Then those values are the same
Examples:
| value | otherValue |
| 1 | 1 |
| awesome | awesome |
```

Step Definitions:

```

Given /^I store the value "([^"]*)"$/ do |value|
@value = value
end

When /^I grab another value "([^"]*)"$/ do |value|
@another_value = value
end

Then /^those values are the same$/ do
assert_equal(@value, @another_value)
end
```

@aslakhellesoy made the commit, so I'm asking for another set of eyes before I just make the commit to fix Scenario Outlines. I'm reasonably confident it has to do with the context that `format()` is being called in. When called using `stepRunner.runSteps()` the formatted context is different than the other, and scenario outlines are broken.