Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
issacto committed Jun 27, 2023
1 parent 110129c commit 136e377
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,15 @@ public void it_throws_when_program_argument_is_not_present() {
ex.getMessage());
}

@Test
public void it_throws_when_program_argument_is_not_presen_and_has_other_argument() {
Throwable ex = assertThrows(CommandLineArgumentException.class, () -> {
ArgumentHandler argumentHandler = new ArgumentHandler(new String[] {"-c", "config.properties" },
optionSpec);
argumentHandler.loadArgProgramPaths();
});
assertEquals("ERR030: Command line missing program argument '-p programName' .",
ex.getMessage());
}

}

0 comments on commit 136e377

Please sign in to comment.