use of cucumber.runtime.formatter.FormatterSpy in project cucumber-jvm by cucumber.
the class FormatterMissingLifecycleMethods method handles_formatters_missing_startOfScenarioLifeCycle_endOfScenarioLifeCycle.
@Test
public void handles_formatters_missing_startOfScenarioLifeCycle_endOfScenarioLifeCycle() throws Throwable {
CucumberFeature feature = TestHelper.feature("path/test.feature", "" + "Feature: feature name\n" + " Scenario: scenario name\n" + " Given step\n");
FormatterSpy formatterSpy = new FormatterSpy();
RuntimeOptions runtimeOptions = new RuntimeOptions("");
runtimeOptions.addPlugin(new FormatterMissingLifecycleMethods());
runtimeOptions.addPlugin(formatterSpy);
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
TestHelper.runFeatureWithFormatter(feature, new HashMap<String, String>(), runtimeOptions.formatter(classLoader), runtimeOptions.reporter(classLoader));
assertEquals("" + "uri\n" + "feature\n" + " startOfScenarioLifeCycle\n" + " scenario\n" + " step\n" + " match\n" + " result\n" + " endOfScenarioLifeCycle\n" + "eof\n" + "done\n" + "close\n", formatterSpy.toString());
}
use of cucumber.runtime.formatter.FormatterSpy in project cucumber-jvm by cucumber.
the class RuntimeTest method runFeatureWithFormatterSpy.
private String runFeatureWithFormatterSpy(CucumberFeature feature, Map<String, Result> stepsToResult) throws Throwable {
FormatterSpy formatterSpy = new FormatterSpy();
TestHelper.runFeatureWithFormatter(feature, stepsToResult, Collections.<SimpleEntry<String, Result>>emptyList(), 0L, formatterSpy, formatterSpy);
return formatterSpy.toString();
}
Aggregations