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


Reply via email to