Skip to content

Commit

Permalink
test: Added test for wrong name
Browse files Browse the repository at this point in the history
Tests that the name given by the user matches the template
  • Loading branch information
quintesse authored Mar 21, 2022
1 parent 84965d1 commit 55fab25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/java/dev/jbang/cli/TestInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ void testInitMultipleFilesWrongName() throws IOException {
testFailMultipleFiles("{filename}", "edit.md", "edit.java", true, 2);
}

@Test
void testInitMultipleFilesWrongName2() throws IOException {
testFailMultipleFiles("{basename}.java", "edit.md", "edit.java", true, 2);
}

void testInitMultipleFiles(String targetName, String initName, String outName, boolean abs) throws IOException {
Path outFile = setupInitMultipleFiles(targetName, initName, abs);
int result = JBang.getCommandLine().execute("init", "-t=name", outFile.toString());
Expand Down

0 comments on commit 55fab25

Please sign in to comment.