[
http://jira.codehaus.org/browse/JBEHAVE-215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=201921#action_201921
]
Cristiano Gavião commented on JBEHAVE-215:
------------------------------------------
The solution was to indicate on textual sentence the tableColumn to be used,
and that must be between <> or {} or [] or ().
So, if example table is being used in scenario jbehave will take its values...
{code}
Scenario:
In order to ensure a quick response
As a trader
I want to monitor stock prices
Given a stock of <symbol> and a {threshold}
When the stock is traded with [price]
Then the trader is alerted with (status)
Examples:
|symbol|threshold|price|status|
|STK1|15.0|5.0|OFF|
|STK1|15.0|11.0|OFF|
|STK1|15.0|16.0|ON|
{code}
> Allow a step to be reused between scenarios with and without example tables
> ---------------------------------------------------------------------------
>
> Key: JBEHAVE-215
> URL: http://jira.codehaus.org/browse/JBEHAVE-215
> Project: JBehave
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.4
> Reporter: Cristiano Gavião
> Fix For: 2.4
>
>
> I would like to reuse Step classes and its methods in both scenarios that
> don't use example tables and also in scenarios that I want to use it.
> For example:
> {code}
> This scenario we don't use example table, and its very flexible and reusable:
> Given that user is editing Suppliers
> When user input 12 for rankNumber
> And input 3300,00 for maxValue
> Then system sends a email to the managers with title 'Supplier rank was
> changed'.
> {code}
> For this work today I just need to create a step method like this:
> {code}
> @When("user inputs $value for $field")
> @Alias("inputs $value for $field")
> public void whenUserInputsValue(@Named("field") String pField,
> @Named("value") String pValue)
> {
> }
> {code}
> That step method is very reusable indeed a lot of scenarios could use it.
> But if I want to use the benefit of an Example table in this scenario (maybe
> I found out others businesse rules that could be treat here too), I don't
> have this flexibility anymore, because Example table needs the steps sentence
> be fixed and table column matching @Named parameters.
> So I will need to construct other method for the same purpose.
> Today example tables need that the column tables match the parameter names
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email