use of io.cucumber.core.options.PluginOption in project cucumber-jvm by cucumber.
the class PluginFactoryTest method instantiates_pretty_plugin_with_file_arg.
@Test
void instantiates_pretty_plugin_with_file_arg() throws IOException {
PluginOption option = parse("pretty:" + tmp.resolve("out.txt").toUri().toURL());
plugin = fc.create(option);
assertThat(plugin.getClass(), is(equalTo(PrettyFormatter.class)));
}
use of io.cucumber.core.options.PluginOption in project cucumber-jvm by cucumber.
the class PluginFactoryTest method instantiates_usage_plugin_without_file_arg.
@Test
void instantiates_usage_plugin_without_file_arg() {
PluginOption option = parse("usage");
plugin = fc.create(option);
assertThat(plugin.getClass(), is(equalTo(UsageFormatter.class)));
}
use of io.cucumber.core.options.PluginOption in project cucumber-jvm by cucumber.
the class PluginFactoryTest method fails_to_instantiate_plugin_that_wants_too_much.
@Test
void fails_to_instantiate_plugin_that_wants_too_much() {
PluginOption option = parse(WantsTooMuch.class.getName());
Executable testMethod = () -> fc.create(option);
CucumberException exception = assertThrows(CucumberException.class, testMethod);
assertThat(exception.getMessage(), is(equalTo("class io.cucumber.core.plugin.PluginFactoryTest$WantsTooMuch must have at least one empty constructor or a constructor that declares a single parameter of one of: [class java.lang.String, class java.io.File, class java.net.URI, class java.net.URL, class java.io.OutputStream, interface java.lang.Appendable]")));
}
use of io.cucumber.core.options.PluginOption in project cucumber-jvm by cucumber.
the class PluginFactoryTest method instantiates_wants_nothing_plugin.
@Test
void instantiates_wants_nothing_plugin() {
PluginOption option = parse(WantsNothing.class.getName());
WantsNothing plugin = (WantsNothing) fc.create(option);
assertThat(plugin.getClass(), is(equalTo(WantsNothing.class)));
}
use of io.cucumber.core.options.PluginOption in project cucumber-jvm by cucumber.
the class PluginFactoryTest method creates_parent_directories.
@Test
void creates_parent_directories() {
Path file = tmp.resolve("target/cucumber/reports/rerun.txt");
PluginOption option = parse("rerun:" + file);
assertAll(() -> assertThat(Files.exists(file), is(false)), () -> assertDoesNotThrow(() -> {
Object plugin = fc.create(option);
releaseResources(plugin);
}), () -> assertThat(Files.exists(file), is(true)));
}
Aggregations