diff --git a/docs/features.rst b/docs/features.rst index 3169a56..bee4556 100644 --- a/docs/features.rst +++ b/docs/features.rst @@ -41,7 +41,7 @@ could also be several features in a given file, but this is not recommended in general (this is an extension of the format used by cucumber). The scenario is split into several **steps**, each of which start on a separate -line. The steps are introduced by one of severaal keywords, all shown in bold +line. The steps are introduced by one of several keywords, all shown in bold in the example above. You can use any of the keywords for any of the steps, but in general they have the following semantic: @@ -57,7 +57,7 @@ in general they have the following semantic: * **Then** observes the outcome of the actions. These observations should be related to the business benefit that was described in the feature. The observation should be on some kind of output that is something that comes out - of the system (report, user interface, message,...) and preferrably not + of the system (report, user interface, message,...) and preferably not something deeply buried in the system (use unit tests for those instead). The example above indents each level of the description. This is not diff --git a/docs/steps.rst b/docs/steps.rst index 88a2b1e..09902af 100644 --- a/docs/steps.rst +++ b/docs/steps.rst @@ -154,7 +154,8 @@ The comment must occur just before the subprogram to which it applies. With comments, how do we handle cases where the regexp is too long to fix on a line, except for using pragma Style_Checks(Off). -The comments should start with one of '@given', '@then' or '@when'. +The comments should start with one of '@given', '@then', '@and', '@but' +or '@when'. There is no semantic difference, they only act as a way to help introduce the regexp. diff --git a/example/features/step_definitions/mysteps1.ads b/example/features/step_definitions/mysteps1.ads index b27fb86..52860c5 100644 --- a/example/features/step_definitions/mysteps1.ads +++ b/example/features/step_definitions/mysteps1.ads @@ -9,7 +9,7 @@ package MySteps1 is -- @then ^I should read %integer$ procedure Then_I_Should_Read (Result : Integer); - -- @then ^the stack should contain$ + -- @and ^the stack should contain$ procedure Then_The_Stack_Should_Contain (Expected : BDD.Tables.Table); end MySteps1; diff --git a/src/gnatbdd/gnatbdd-codegen.adb b/src/gnatbdd/gnatbdd-codegen.adb index 2e38cb4..9b56435 100644 --- a/src/gnatbdd/gnatbdd-codegen.adb +++ b/src/gnatbdd/gnatbdd-codegen.adb @@ -49,7 +49,7 @@ package body Gnatbdd.Codegen is Compile ("^package ([_\.\w]+)", Case_Insensitive or Multiple_Lines); Cst_Comment_Re : constant Pattern_Matcher := - Compile ("--\s*@(given|then|when)\s+"); + Compile ("--\s*@(given|then|when|and|but)\s+"); -- Matches the special comments before step definitions Cst_Setup_Re : constant Pattern_Matcher :=