[ 
http://jira.codehaus.org/browse/JBEHAVE-372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=240587#action_240587
 ] 

Mauro Talevi edited comment on JBEHAVE-372 at 10/22/10 4:32 AM:
----------------------------------------------------------------

Any sequence of scenarios containing parametrised steps, using exactly the same 
mechanism in play with the Examples. E.g.

{code}
GivenStories: org/jbehave/examples/trader/stories/parametrised.story#{0}
              
When the stock is traded at price 1.1
Then the alert status is ON

Examples:
|symbol|threshold|
|STK1  |1.0|
{code}
where the parametrised story might look like:
{code}
Scenario:

Given a stock of <symbol> and a <threshold>
{code}

The parameters are picked up from the table row specified in the anchor.   So 
we now have parametrised GivenStories, in addition to the parametrised 
Scenarios we've always had.

Note that since the Examples table is used to provide data to the GivenStories, 
it is not being used to parametrise at the same time the scenario itself (it 
looks for the presence of anchors in the GivenStories paths).  Nothing 
technically stopping us from using the examples table in parametrising both the 
GivenStories and the scenario itself, but it'd most probably lead to confusion. 
  We could use the new feature of ExamplesTable (JBEHAVE-371) to pass in some 
directive, e.g.:

{code}
Examples:
{scope=Scenario}
|symbol|threshold|
|STK1  |1.0|
{code}

But that's probably another story ... 

      was (Author: maurotalevi):
    Any sequence of scenarios containing parametrised steps, using exactly the 
same mechanism in play with the Examples. E.g.

{code}
GivenStories: org/jbehave/examples/trader/stories/parametrised.story#{0}
              
When the stock is traded at price 1.1
Then the alert status is ON

Examples:
|symbol|threshold|
|STK1  |1.0|
{code}
where the parametrised story might look like:
{code}
Scenario:

Given a stock of <symbol> and a <threshold>
{code}

The parameters are picked up from the table row specified in the anchor.   So 
we now have parametrised GivenStories, in addition to the parametrised 
Scenarios we've always had.

Note that since the Examples table is used to provide data to the GivenStories, 
it is not being used to parametrise at the same time the scenario itself (it 
looks for the presence of anchors in the GivenStories paths).  Nothing 
technically stopping us from using the examples table in parametrising both the 
GivenStories and the scenario itself, but it'd most probably lead to confusion. 
  We could use the new feature of ExamplesTable (JBEHAVE-371) to pass in some 
directive, e.g.:

{code}
{scope=Scenario}
Examples:
|symbol|threshold|
|STK1  |1.0|
{code}

But that's probably another story ... 
  
> Parametrised GivenStories
> -------------------------
>
>                 Key: JBEHAVE-372
>                 URL: http://jira.codehaus.org/browse/JBEHAVE-372
>             Project: JBehave
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Mauro Talevi
>            Assignee: Mauro Talevi
>             Fix For: 3.1
>
>
> GivenStories could be parametrised, using the same mechanism of the 
> ExamplesTable and the named parameters. 
> If a GivenStory path has an anchor with a number, e.g. 
> GivenStories: /path/to/precondition.story#{0}
> then the number is assumed to be the row of the ExamplesTable containing the 
> required parameters (if present). 

-- 
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