Hi Cristiano,

Ronald spotted that what was supposed to be the same pattern, actually
wasn't ("a stock" instead of "the stock" ... )

Cheers

On 09/09/2010 11:41, Cristiano Gavião wrote:
> Hi Ronald,
>
> Well, I think there isn't a error in documentation... ;-)
>
> The second example will result in an error because there are two
> methods annotated with the same Keyword (@When) and using a similar
> regex pattern (both texts will be resolved the same way) .
>
> But if you observe the first example, the one that works, there are
> two methods annotated, first with @Given and then @When. This allows
> you to use the same pattern on diferent situations in the same story.
>
> cheers
>
> Cristiano
>
> Ronald Haring escreveu:
>> Hello all,
>>
>> first of let me start with the usual 'Hurrays for this project', so
>> here it is,
>> 'Hurray' for JBehave. I have been reading through the documentation
>> and it seems
>> very clear to me. However on the following page:
>> http://jbehave.org/reference/stable/candidate-steps.html I think that
>> an error
>> has crept into the documentation.
>> It states that:
>> Hence, the following two methods are allowed to have the same regex
>> pattern,
>> because they correspond to different step types:
>> @Given("a stock is traded at $price")
>> public void aStockWithPrice(double price) {
>>     // ...
>> }
>>  
>> @When("the stock is traded at $price")
>> public void theStockIsTradedAt(double price) {
>>     // ...
>> }
>>
>> By contrast, the following would result in a runtime failure when
>> running the
>> scenario:
>> view source
>> print?
>> @When("a stock is traded at $price")
>> public void aStockWithPrice(double price) {
>>     // ...
>> }
>>  
>> @When("the stock is traded at $price")
>> public void theStockIsTradedAt(double price) {
>>     // ...
>> }
>>
>> However as I understand it, shouldnt the second annotations have the
>> exact same
>> description? So, in the code it should be @When("a stock is traded at
>> $price")
>> instead of @When("the stock is traded at $price").
>>
>> Regards
>> Ronald
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>   
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


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

    http://xircles.codehaus.org/manage_email


Reply via email to