Search in sources :

Example 1 with PluginFactory

use of cucumber.runtime.formatter.PluginFactory in project cucumber-jvm by cucumber.

the class FormatterMissingLifecycleMethods method set_monochrome_on_color_aware_formatters.

@Test
public void set_monochrome_on_color_aware_formatters() throws Exception {
    PluginFactory factory = mock(PluginFactory.class);
    Formatter colorAwareFormatter = mock(Formatter.class, withSettings().extraInterfaces(ColorAware.class));
    when(factory.create("progress")).thenReturn(colorAwareFormatter);
    RuntimeOptions options = new RuntimeOptions(new Env(), factory, asList("--monochrome", "--plugin", "progress"));
    options.getPlugins();
    verify((ColorAware) colorAwareFormatter).setMonochrome(true);
}
Also used : ColorAware(cucumber.runtime.formatter.ColorAware) Formatter(gherkin.formatter.Formatter) PluginFactory(cucumber.runtime.formatter.PluginFactory) Test(org.junit.Test)

Example 2 with PluginFactory

use of cucumber.runtime.formatter.PluginFactory in project cucumber-jvm by cucumber.

the class FormatterMissingLifecycleMethods method set_strict_on_strict_aware_formatters.

@Test
public void set_strict_on_strict_aware_formatters() throws Exception {
    PluginFactory factory = mock(PluginFactory.class);
    Formatter strictAwareFormatter = mock(Formatter.class, withSettings().extraInterfaces(StrictAware.class));
    when(factory.create("junit:out/dir")).thenReturn(strictAwareFormatter);
    RuntimeOptions options = new RuntimeOptions(new Env(), factory, asList("--strict", "--plugin", "junit:out/dir"));
    options.getPlugins();
    verify((StrictAware) strictAwareFormatter).setStrict(true);
}
Also used : Formatter(gherkin.formatter.Formatter) PluginFactory(cucumber.runtime.formatter.PluginFactory) StrictAware(cucumber.runtime.formatter.StrictAware) Test(org.junit.Test)

Aggregations

PluginFactory (cucumber.runtime.formatter.PluginFactory)2 Formatter (gherkin.formatter.Formatter)2 Test (org.junit.Test)2 ColorAware (cucumber.runtime.formatter.ColorAware)1 StrictAware (cucumber.runtime.formatter.StrictAware)1