Search in sources :

Example 1 with RunningStory

use of org.jbehave.core.embedder.StoryManager.RunningStory in project jbehave-core by jbehave.

the class StoryManagerBehaviour method shouldEnsureStoryReportOutputDirectoryExistsWhenWritingStoryDurations.

@Test
public void shouldEnsureStoryReportOutputDirectoryExistsWhenWritingStoryDurations() throws IOException {
    Configuration configuration = new MostUsefulConfiguration();
    configuration.storyReporterBuilder().withRelativeDirectory("inexistent");
    File outputDirectory = configuration.storyReporterBuilder().outputDirectory();
    FileUtils.deleteDirectory(outputDirectory);
    assertThat(outputDirectory.exists(), is(false));
    StoryManager manager = new StoryManager(configuration, stepsFactory, embedderControls, embedderMonitor, executorService, performableTree);
    Collection<RunningStory> runningStories = new ArrayList<>();
    manager.writeStoryDurations(runningStories);
    assertThat(outputDirectory.exists(), is(true));
}
Also used : RunningStory(org.jbehave.core.embedder.StoryManager.RunningStory) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) Configuration(org.jbehave.core.configuration.Configuration) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) ArrayList(java.util.ArrayList) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)1 ArrayList (java.util.ArrayList)1 Configuration (org.jbehave.core.configuration.Configuration)1 MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)1 RunningStory (org.jbehave.core.embedder.StoryManager.RunningStory)1 Test (org.junit.Test)1