Hi Tim,

you've hit upon some corner cases,  that in practice are very unlikely
to happen.  In particular, it does not make sense to start a scenario
with And.  JBehave recognises the keyword and tries to match it with the
first available candidate step it finds.    Perhaps it could mark it as
pending?

The other issue is more significant IMO, but it only happens when you
have the same pattern in both @Given and @When annotations.   Again the
And step picks up the first pattern it finds, because there is no such
thing as the "And" step type (yet:-). 

Can you please create a Jira issue for this so we can track it and
address it?

Cheers

On 27/04/2010 19:14, Tim Moore wrote:
> On http://jbehave.org/reference/latest/concepts.html it states:
>
> "A step starting with And assumes the same meaning of the previous step"
>
> but this clearly isn't the case in practise, nor does it even require any
> preceeding step type to be defined. For example:
>
>
> public class Steps extends org.jbehave.scenario.steps.Steps {
>   @When("the wind blows")
>   public void theWindBlows() { System.err.println("when it blows then boom"); 
> }
>   @Given("the wind blows")
>   public void theWindBlows2() { System.err.println("given it blows then 
> boom"); }
> }
>
>
> Scenario: Test
>
>   And the wind blows
> Given the wind blows
>   And the wind blows
>  When the wind blows
>   And the wind blows
>
>
> Outputs:
>
> when it blows then boom
> given it blows then boom
> when it blows then boom
> when it blows then boom
> when it blows then boom
>
>
> This doesn't seem very clever for several obvious reasons. Is there any plan
> for AndSteps to conform to the specification on the web site, which seems to
> make sense to me.
>
> Apologies if the issue has already been raised - searching for "And Step"
> doesn't work terribly well!
>
> Tim
>
>
>   


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to