StoryReporter forces me to write non thread safe code

Description

The StoryBuilder interface includes the following methods

void beforeStory(Story story, boolean givenStory);
void beforeScenario(String scenarioTitle);
void beforeExamples(List<String> steps, ExamplesTable table);

Which forces me to store the story and scenario in local variables in order to know exactly which examples are about to be run in my beforeExamples method. This results in a slightly ugly but definately not thread safe StoryBuilder implementation. It also forces me to implement beforeStory() and beforeScenario() when I was actually only interested in beforeExamples()

If the methods were:
void beforeStory(Story story, boolean givenStory);
void beforeScenario(Story story, boolean givenStory, String scenarioTitle);
void beforeExamples(Story story, boolean givenStory, String scenarioTitle, List<String> steps, ExamplesTable table);

I would not need to keep track of the current state and my implementation could be Thread safe (and prettier).

Activity

Show:

Details

Assignee

Reporter

Components

Affects versions

Priority

Created July 1, 2011 at 7:21 AM
Updated July 8, 2011 at 9:25 AM