Details
-
Type: Improvement
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: 3.4.5
-
Fix Version/s: None
-
Component/s: Core
-
Labels:None
-
Number of attachments :
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).
I forgot to mention that I only referenced 3 methods as an example. Most methods in the interface will need the extra parameter(s) added.