Skip to content

Commit d19ae6c

Browse files
committed
Throw on unexpected errors in the compatibility test
1 parent 1cc955a commit d19ae6c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

compatibility/src/test/java/io/cucumber/compatibility/CompatibilityTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ void produces_expected_output_for(TestCase testCase) throws IOException {
4848
new MessageFormatter(newOutputStream(outputNdjson)))
4949
.build()
5050
.run();
51-
} catch (Exception ignored) {
52-
51+
} catch (Exception e) {
52+
// exception: Scenario with unknown parameter types fails by throwing an exceptions
53+
if (!"unknown-parameter-type".equals(testCase.getId())) {
54+
throw e;
55+
}
5356
}
5457

5558
// exception: Cucumber JVM does not support named hooks

compatibility/src/test/java/io/cucumber/compatibility/TestCase.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
final class TestCase {
1818

19-
private static final Path FEATURES_DIRECTORY = Paths.get("src/test/resources/features");
19+
private static final String FEATURES_DIRECTORY = "src/test/resources/features";
2020
private static final String FEATURES_PACKAGE = "io.cucumber.compatibility";
2121

2222
private final String id;
@@ -27,7 +27,8 @@ private TestCase(String id) {
2727

2828
static List<TestCase> testCases() throws IOException {
2929
List<TestCase> testCases = new ArrayList<>();
30-
try (DirectoryStream<Path> stream = Files.newDirectoryStream(FEATURES_DIRECTORY)) {
30+
Path dir = Paths.get(FEATURES_DIRECTORY);
31+
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir)) {
3132
for (Path path : stream) {
3233
if (path.toFile().isDirectory()) {
3334
testCases.add(new TestCase(path.getFileName().toString()));

0 commit comments

Comments
 (0)