Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when feature / glue paths passed as file schemes #2547

Merged
merged 13 commits into from
May 17, 2022
Prev Previous commit
Next Next commit
Use original short wording, it was better
mpkorstanje committed May 8, 2022
commit b758e8cc5a868c67fe33917bf35934d6af45ac04
2 changes: 1 addition & 1 deletion core/src/main/java/io/cucumber/core/feature/GluePath.java
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ private static void warnWhenWellKnownProjectSourceDirectory(String gluePath) {
}
String packageName = classPathResource.replaceAll("/", ".");
String message = "" +
"Consider changing the glue path from '%s' to '%s'.\n'" +
"Consider replacing glue path '%s' with '%s'.\n'" +
"\n" +
"The current glue path points to a source directory in your project. However " +
"cucumber looks for glue (i.e. step definitions) on the classpath. By using a " +
18 changes: 9 additions & 9 deletions core/src/test/java/io/cucumber/core/feature/GluePathTest.java
Original file line number Diff line number Diff line change
@@ -150,24 +150,24 @@ static Stream<Arguments> GluePathAndPatternProvider() {
return Stream.of(
arguments("src/main/java/com/example/package",
equalTo("" +
"Consider changing the glue path from " +
"'src/main/java/com/example/package' to " +
"Consider replacing glue path " +
"'src/main/java/com/example/package' with " +
"'com.example.package'.\n" +
"'\n" +
"The current glue path points to a source " +
"directory in your project. However cucumber " +
"looks for glue (i.e. step definitions) on the " +
"classpath. By using a package name you can " +
"avoid this ambiguity.")),
arguments("src/main/java", containsString("to ''")),
arguments("src/main/java/", containsString("to ''")),
arguments("src/main/java", containsString("with ''")),
arguments("src/main/java/", containsString("with ''")),
arguments("src/main/java_other", nullValue()),
arguments("src/main/other", nullValue()),
arguments("src/main/java/com", containsString("to 'com'")),
arguments("src/main/java/com/", containsString("to 'com'")),
arguments("src/main/groovy/com", containsString("to 'com'")),
arguments("src/main/java/com/example", containsString("to 'com.example'")),
arguments("src/main/java/com/example/", containsString("to 'com.example'")));
arguments("src/main/java/com", containsString("with 'com'")),
arguments("src/main/java/com/", containsString("with 'com'")),
arguments("src/main/groovy/com", containsString("with 'com'")),
arguments("src/main/java/com/example", containsString("with 'com.example'")),
arguments("src/main/java/com/example/", containsString("with 'com.example'")));
}

}