Skip to content

Commit

Permalink
Merge pull request #170 from trivago/156-invalid-class-name
Browse files Browse the repository at this point in the history
156 invalid class name
  • Loading branch information
Benjamin Bischoff authored Aug 15, 2020
2 parents d0ac8a7 + 4f42584 commit 3339fa2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Back to [Readme](README.md).
### Fixed

* Correct handling of feature tags in combination with multiple tagged example tables (#168)
* Invalid runner class name for features beginning with numbers (#156)

## [1.7.2] - 2020-04-03

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ All changes are documented in the [full changelog](CHANGELOG.md).

The `[CUCABLE:RUNNER]` template placeholder is automatically replaced with the class name of the generated runner class.

If the generated runner runs only one "single scenario" feature, its name will be the same as the generated feature (e.g. `MyFeature_scenario001_run001_IT`).
If the generated runner runs only one "single scenario" feature, its name will be the same as the generated feature (e.g. `Runner_MyFeature_scenario001_run001_IT`).

In case the runner runs multiple "single scenario" features, its name will be auto-generated (e.g. `CucableMultiRunner_1da810a2_c4c6_4edb_b078_d81329593950_IT`).

Expand Down Expand Up @@ -624,7 +624,7 @@ The generated runners point to each one of the generated feature files (unless y

This is an example for one of the generated runners - note how the placeholders are now replaced with the name of the feature to run:

*MyFeature_scenario001_run001_IT.java*
*Runner_MyFeature_scenario001_run001_IT.java*

<pre>
import cucumber.api.CucumberOptions;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Feature: A feature starting with a number

Scenario: Scenario 1
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ private String getRenderedFeatureFileContent(List<SingleScenario> singleScenario
);
addSteps(renderedContent, singleScenario.getBackgroundSteps());
addSteps(renderedContent, singleScenario.getSteps());

}

addComments(renderedContent, firstScenario.getFeatureFilePath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ private void generateRunnerClass(final List<String> generatedFeatureFileNames) t
// Otherwise, a generated runner class name is used.
String runnerClassName;
if (generatedFeatureFileNames.size() == 1) {
runnerClassName = generatedFeatureFileNames.get(0);
runnerClassName = "Runner_" + generatedFeatureFileNames.get(0);
} else {
runnerClassName = "CucableMultiRunner_"
.concat(UUID.randomUUID().toString().replace("-", "_"))
Expand Down

0 comments on commit 3339fa2

Please sign in to comment.