Search in sources :

Example 1 with ColorAware

use of io.cucumber.plugin.ColorAware in project cucumber-jvm by cucumber.

the class Plugins method setMonochromeOnColorAwarePlugins.

private void setMonochromeOnColorAwarePlugins(Plugin plugin) {
    if (plugin instanceof ColorAware) {
        ColorAware colorAware = (ColorAware) plugin;
        colorAware.setMonochrome(pluginOptions.isMonochrome());
    }
}
Also used : ColorAware(io.cucumber.plugin.ColorAware)

Example 2 with ColorAware

use of io.cucumber.plugin.ColorAware in project cucumber-jvm by cucumber.

the class PluginsTest method shouldSetMonochromeOnPlugin.

@Test
void shouldSetMonochromeOnPlugin() {
    RuntimeOptions runtimeOptions = RuntimeOptions.defaultOptions();
    Plugins plugins = new Plugins(pluginFactory, runtimeOptions);
    ColorAware plugin = mock(ColorAware.class);
    plugins.addPlugin(plugin);
    verify(plugin).setMonochrome(false);
}
Also used : ColorAware(io.cucumber.plugin.ColorAware) RuntimeOptions(io.cucumber.core.options.RuntimeOptions) Test(org.junit.jupiter.api.Test)

Aggregations

ColorAware (io.cucumber.plugin.ColorAware)2 RuntimeOptions (io.cucumber.core.options.RuntimeOptions)1 Test (org.junit.jupiter.api.Test)1