Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters can defined using the '%' prefix character #40

Closed
Arnauld opened this issue Mar 20, 2012 · 3 comments
Closed

Parameters can defined using the '%' prefix character #40

Arnauld opened this issue Mar 20, 2012 · 3 comments

Comments

@Arnauld
Copy link
Owner

Arnauld commented Mar 20, 2012

Parameters are defined using the '%' prefix whereas the documentation indicates:

The simplest default behaviour identifies arguments in the candidate step by the words
prefixed by the $character. -- http://jbehave.org/reference/stable/developing-stories.html

@Arnauld
Copy link
Owner Author

Arnauld commented Mar 20, 2012

In fact configuration allows to setup any StepPatternParser implementation, and predefined one allows to customized the prefix:

return new MostUsefulConfiguration()
            ...
            // use '%' instead of '$' to identify parameters
            .useStepPatternParser(new RegexPrefixCapturingPatternParser("%")) 
            ...

From TraderStories.java

Currently the only implementation available is RegexPrefixCapturingPatternParser which accepts different prefix, according to this, a new option should be added in project preferences to define the prefix used within the whole project. If a more fine grained setting is required, preference should be added on a per editor basis, which won't be done for now.

@Arnauld
Copy link
Owner Author

Arnauld commented Mar 20, 2012

This would be a temporary solution until the possibility to associate a dedicated Runner to a story is available.

Note for myself: The runner will be responsible for configuring the JBehave Embedder in such way it could be used by the plugin to analyse available classes and figure out all candidates steps. One mustn't forget that the plugin would probably not be working at JDT level but at class level: performance would probably be impacted...

@Arnauld
Copy link
Owner Author

Arnauld commented May 13, 2012

Done in master should be available in 1.0.7
Preferences allow to define the wanted prefix on a per project (or general too) basis

@Arnauld Arnauld closed this as completed May 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant