Skip to content

Commit

Permalink
feat: camel-kebab-case allowed in init
Browse files Browse the repository at this point in the history
Related to quarkusio#460
  • Loading branch information
maxandersen committed Nov 6, 2020
1 parent e9f9723 commit cfcc9f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/dev/jbang/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static String getBaseName(String fileName) {
if (index == -1) {
return kebab2camel(fileName);
} else {
return fileName.substring(0, index);
return kebab2camel(fileName.substring(0, index));
}
}

Expand Down
12 changes: 11 additions & 1 deletion src/test/java/dev/jbang/cli/TestInit.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package dev.jbang.cli;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertEquals;

import java.io.File;
Expand All @@ -24,6 +26,14 @@ void testInit() {
assertThat(s, containsString("class test"));
}

@Test
void testBadInit() {

String s = new Init().renderInitClass(new File("generate-clusters.java"), "hello");

assertThat(s, containsString("class GenerateClusters"));
}

@Test
void testCli(@TempDir Path outputDir) throws IOException {

Expand Down

0 comments on commit cfcc9f7

Please sign in to comment.