Details
-
Type: New Feature
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Core
-
Labels:None
-
Number of attachments :
Description
Provide an enum to allow story writers to write natural prose, while developers can enjoy getting booleans "for free".
Quoting from the javadoc..
Example of use. Given the following candidate step:
@Given("a stock of symbol $symbol $withThreshold a threshold") public void aStock(String symbol, BooleanWord withThreshold) { stock = new Stock(symbol).withThreshold(withThreshold.toBoolean()); }
.. it is then possible to write the following scenarios:
Scenario: a stock with threshold Given a stock of symbol AAA with a threshold When .. Then .. Scenario: a stock with no threshold Given a stock of symbol AAA without a threshold When .. Then ..
Please note that this depends on JBEHAVE-1075.
It would be nice if we could find an elegant way to internationalise the enum constants.
One where there is only one enum constant for each boolean word, and the translations are kept in an external file. Any ideas?
Activity
Alberto Scotto
made changes -
Field | Original Value | New Value |
---|---|---|
Description |
Provide an enum to allow story writers to write natural prose, while developers can enjoy getting booleans "for free".
Quoting from the javadoc.. Example of use. Given the following candidate step: {code} @Given("a stock of symbol $symbol $withThreshold a threshold") public void aStock(String symbol, BooleanWord withThreshold) { stock = new Stock(symbol).withThreshold(withThreshold.toBoolean()); } {code} .. it is then possible to write the following scenarios: {code} Scenario: a stock with threshold Given a stock of symbol AAA with a threshold When .. Then .. Scenario: a stock with no threshold Given a stock of symbol AAA without a threshold When .. Then .. {code} Please note that this depends on #77. It would be nice if we could find an elegant way to internationalise the enum constants. One where there is only one enum constant for each boolean word, and the translations are kept in an external file. Any ideas? |
Provide an enum to allow story writers to write natural prose, while developers can enjoy getting booleans "for free".
Quoting from the javadoc.. Example of use. Given the following candidate step: {code} @Given("a stock of symbol $symbol $withThreshold a threshold") public void aStock(String symbol, BooleanWord withThreshold) { stock = new Stock(symbol).withThreshold(withThreshold.toBoolean()); } {code} .. it is then possible to write the following scenarios: {code} Scenario: a stock with threshold Given a stock of symbol AAA with a threshold When .. Then .. Scenario: a stock with no threshold Given a stock of symbol AAA without a threshold When .. Then .. {code} Please note that this depends on It would be nice if we could find an elegant way to internationalise the enum constants. One where there is only one enum constant for each boolean word, and the translations are kept in an external file. Any ideas? |
https://github.com/jbehave/jbehave-core/pull/79