Search in sources :

Example 1 with ColorAware

use of cucumber.runtime.formatter.ColorAware 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 ColorAware

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

the class RuntimeOptions method setMonochromeOnColorAwarePlugins.

private void setMonochromeOnColorAwarePlugins(Object plugin) {
    if (plugin instanceof ColorAware) {
        ColorAware colorAware = (ColorAware) plugin;
        colorAware.setMonochrome(monochrome);
    }
}
Also used : ColorAware(cucumber.runtime.formatter.ColorAware)

Aggregations

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