Default StoryParser should rely on Keywords and ExamplesTableFactory from configuration

Description

The current implementation of Configuration relies on RegexStoryParser constructor which accepts StoryLoader and TableTransformers:

public StoryParser storyParser() { if (storyParser == null) { storyParser = new RegexStoryParser(storyLoader(), tableTransformers()); } return storyParser; }

and then the constructor instantiates own LocalizedKeywords and ExamplesTableFactory:

public RegexStoryParser(ResourceLoader resourceLoader, TableTransformers tableTransformers) { this(new LocalizedKeywords(), resourceLoader, tableTransformers); } public RegexStoryParser(Keywords keywords, ResourceLoader resourceLoader, TableTransformers tableTransformers) { this(keywords, new ExamplesTableFactory(keywords, resourceLoader, tableTransformers)); }

This leads to necessity to set own StoryParser when custom Keywords and/or ExamplesTableFactory are used.

The implementation of Configuration should be updated to create default StoryParser using the provided Keywords and ExamplesTableFactory.

Activity

Show:

Mauro Talevi November 14, 2019 at 9:03 AM

Pulled with thanks!

Valery Yatsynovich November 9, 2019 at 6:10 PM

Hi ,

Could you please review the pull request: https://github.com/jbehave/jbehave-core/pull/257/files?

Thanks

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created November 9, 2019 at 5:35 PM
Updated November 14, 2019 at 9:03 AM
Resolved November 14, 2019 at 9:03 AM

Flag notifications