@Test public void it_should_reset_properly() { schemeBuilder.addOption(unkownOpt); schemeBuilder.reset(); schemeBuilder.addOption(firstOpt); CommandScheme scheme = schemeBuilder.buildScheme(); assertThat(scheme.hasOption("unknown option"), is(false)); assertThat(scheme.hasOption("basic option"), is(true)); }
@Test public void it_should_produce_a_scheme_that_knows_only_the_added_options() { schemeBuilder.addOption(firstOpt); CommandScheme scheme = schemeBuilder.buildScheme(); assertThat(scheme.hasOption("unknown option"), is(false)); }
@Test public void it_should_build_a_scheme() { schemeBuilder.addOption(firstOpt); CommandScheme scheme = schemeBuilder.buildScheme(); assertThat(scheme.hasOption("basic option"), is(true)); }
@Test(expected = IllegalArgumentException.class) public void it_should_complain_when_adding_options_twice() { schemeBuilder.addOption(firstOpt); schemeBuilder.addOption(firstOpt); fail("Only one option with a specific long representation is allowed"); }