use of org.jbehave.core.failures.FailingUponPendingStep in project jbehave-core by jbehave.
the class EmbedderBehaviour method shouldFailWhenGeneratingReportsViewWithPendingSteps.
@Test(expected = RunningStoriesFailed.class)
public void shouldFailWhenGeneratingReportsViewWithPendingSteps() throws Throwable {
// Given
PerformableTree performableTree = mock(PerformableTree.class);
EmbedderControls embedderControls = new EmbedderControls().doGenerateViewAfterStories(false);
OutputStream out = new ByteArrayOutputStream();
EmbedderMonitor monitor = new PrintStreamEmbedderMonitor(new PrintStream(out));
ViewGenerator viewGenerator = mock(ViewGenerator.class);
Embedder embedder = embedderWith(performableTree, embedderControls, monitor);
embedder.configuration().useViewGenerator(viewGenerator).usePendingStepStrategy(new FailingUponPendingStep());
File outputDirectory = new File("target/output");
List<String> formats = asList("html");
Properties viewResources = new Properties();
when(viewGenerator.getReportsCount()).thenReturn(new ReportsCount(2, 0, 1, 2, 0, 0, 1, 0));
embedder.generateReportsView(outputDirectory, formats, viewResources);
// Then
verify(viewGenerator).generateReportsView(outputDirectory, formats, viewResources);
assertThatReportsViewGenerated(out);
}
Aggregations