JBehave

Rename RunnableStory to Embeddable and remove redundant methods

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 3.0
  • Component/s: Core
  • Labels:
    None
  • Number of attachments :
    0

Description

The name RunnableStory has become outdated and does not reflect the fact that we can run multiple stories or even have access to other Embedder functionality. Embeddable is a more generic name that's better suited.

The two methods that should remain in Embeddable are:

void useEmbedder(Embedder);
void run();

The other methods that were previously in RunnableStory can live in abstract implementations, such as ConfigurableEmbedder which JUnitStory extends and allows the configuration of the embedder for execution of a single story.

Activity

Hide
Brian Repko added a comment -

Not sure if this is a related issue or not.

The following method change would make more sense in AbstractStory

protected StoryEmbedder configuredEmbedder() { embedder.useConfiguration(getConfiguration()); embedder.useCandidateSteps(getSteps()); return embedder; }

While the getters are no longer part of the interface, they could be protected and part of the AbstractStory.

This allows a user to configure a story via overriding.

Thus the options for story configuration are:

1. Constructor
2. Lifecycle method (@Before)
3. Overriding getter methods

This is important for use with IoC containers as they should not be started up in the constructor of the test class but rather as part of the running of the test.

Show
Brian Repko added a comment - Not sure if this is a related issue or not. The following method change would make more sense in AbstractStory protected StoryEmbedder configuredEmbedder() { embedder.useConfiguration(getConfiguration()); embedder.useCandidateSteps(getSteps()); return embedder; } While the getters are no longer part of the interface, they could be protected and part of the AbstractStory. This allows a user to configure a story via overriding. Thus the options for story configuration are: 1. Constructor 2. Lifecycle method (@Before) 3. Overriding getter methods This is important for use with IoC containers as they should not be started up in the constructor of the test class but rather as part of the running of the test.
Hide
Mauro Talevi added a comment -

Added protected methods configuration() and candidateSteps() that can be overridden.

Show
Mauro Talevi added a comment - Added protected methods configuration() and candidateSteps() that can be overridden.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: