private Scenario scenario(final ScenarioDetails details, String storyName) {
return new MultiStepScenario() {
public void specifySteps() {
// given
for (Iterator i = details.context.givens.iterator(); i.hasNext();) {
BasicDetails given = (BasicDetails)i.next();
given((Given)builder.newGiven(given.name));
}
// when
when((Event)builder.newEvent(details.event.name));
// then
for (Iterator i = details.outcome.outcomes.iterator(); i.hasNext();) {
BasicDetails outcome = (BasicDetails)i.next();
then((Outcome)builder.newOutcome(outcome.name));
}
}
};
}