Skip to content

Commit

Permalink
[Core] Fix filtering scenarios loaded from jar
Browse files Browse the repository at this point in the history
I am running cucumber tests with features loaded from classpath:, like this:

```
java -cp fatjar.jar cucumber.api.cli.Main "classpath:features/FeatureWithExamples.feature:64"
```

However, when cucumber parses this path and creates a ZipResource from it, it adds an extra slash. This becomes a problem down the line, when LinePredicate tries to filter out the pickles. Instead of filtering the pickles out, it just lets all of the though the filter.

Changed the ZipResource to preserve the original path of the zipped entity.
  • Loading branch information
derwasp authored and mpkorstanje committed May 3, 2019
1 parent 437bb3a commit 25f467f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/cucumber/runtime/io/ZipResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ZipResource implements Resource {

@Override
public URI getPath() {
return URI.create(CLASSPATH_SCHEME_PREFIX + "/" + jarEntry.getName());
return URI.create(CLASSPATH_SCHEME_PREFIX + jarEntry.getName());
}

@Override
Expand Down

0 comments on commit 25f467f

Please sign in to comment.