JBehave
  1. JBehave
  2. JBEHAVE-615

Ignore full-stop/period|punctation at end of step

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6
    • Component/s: Core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      I experienced some trouble especially with @Then steps ending with punctation characters:

      Given I do this
      When I do that
      Then I expect to see the message Hello World.
      

      will require a step definition like

      @Then("I expect to see the message $message.")
      

      Mind that you must not forget the period at the end of the step definition... otherwise message will be Hello World. rathen than Hello World.

      This is a quite common mistake and in addition it prevents the step definition to be reusable here:

      Given I do this
      When I do that
      Then I expect to see the message Hello World
      And the world echoes Hello John.
      

      where it is required to have an Alias just because of the period. Or, as alternative, the assertions inside need to deal with the period at the end.

      It would be nice if JBehave could ignore this period although it is not quite clear to me how to handle scenarios where the period needs to be parsed. And of course such a change might break existing tests.

        Activity

        Hide
        Mauro Talevi added a comment -

        We could make the ignoring of the period configurable in the RegexStoryParser and it would be down to the user to configure it.

        Show
        Mauro Talevi added a comment - We could make the ignoring of the period configurable in the RegexStoryParser and it would be down to the user to configure it.
        Mauro Talevi made changes -
        Field Original Value New Value
        Assignee Mauro Talevi [ maurotalevi ]
        Fix Version/s 3.5.3 [ 18047 ]
        Fix Version/s 3.6 [ 17721 ]
        Priority Major [ 3 ] Minor [ 4 ]
        Mauro Talevi made changes -
        Fix Version/s 3.5.3 [ 18047 ]
        Hide
        Mauro Talevi added a comment -

        You can now use pattern variants (JBEHAVE-702):

        "I expect to see the message $message {|.}"
        
        Show
        Mauro Talevi added a comment - You can now use pattern variants ( JBEHAVE-702 ): "I expect to see the message $message {|.}"
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Mark Michaelis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: