private void runGivenStories( GivenStories givenStories, Map<String, String> parameters, RunContext context) throws Throwable { if (givenStories.getPaths().size() > 0) { reporter.get().givenStories(givenStories); for (GivenStory givenStory : givenStories.getStories()) { RunContext childContext = context.childContextFor(givenStory); // run given story, using any parameters provided Story story = storyOfPath(context.configuration(), childContext.path()); if (givenStory.hasAnchorParameters()) { story = storyWithMatchingScenarios(story, givenStory.getAnchorParameters()); } parameters.putAll(givenStory.getParameters()); run(childContext, story, parameters); } } }
public RunContext childContextFor(GivenStory givenStory) { String actualPath = configuration.pathCalculator().calculate(path, givenStory.getPath()); return new RunContext(configuration, candidateSteps, actualPath, filter, true, this); }