Skip to content

Commit 04cd84f

Browse files
committed
[more tests] test Unknown Argument
1 parent 4e1d59b commit 04cd84f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main/java/com/googlecode/scheme2ddl/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ private static void collectArgs(String[] args) throws Exception {
337337
String msg = "Unknown argument: " + arg;
338338
System.err.println(msg);
339339
printUsage();
340-
throw new Exception("");
340+
throw new Exception(msg);
341341
}
342342
}
343343
}

src/test/java/com/googlecode/scheme2ddl/MainCLITest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,11 @@ public void testPrintVersionOption() throws Exception {
7575
assertThat(outContent.toString(), containsString("scheme2ddl version "));
7676
}
7777

78+
@Test(expectedExceptions = Exception.class, expectedExceptionsMessageRegExp = "Unknown argument: .*")
79+
public void testUnknownArgument() throws Exception {
80+
String[] args = {"-xYx"};
81+
Main.main(args);
82+
}
83+
7884

7985
}

0 commit comments

Comments
 (0)