JBehave
  1. JBehave
  2. JBEHAVE-782

Minor change to function parseScenario in RegexStoryParser

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.6.4
    • Fix Version/s: 3.6.7, 3.7
    • Component/s: Core
    • Labels:
      None
    • Environment:
      N/A
    • Patch Submitted:
      Yes
    • Number of attachments :
      0

      Description

      Problem Statement:
      When the RegexStoryParser parses out a scenario, it attempts to remove the title from the step to get the scenario without title, but the function doesn't account for Scenario:\n before the title. I don't think this will affect anything, and I don't think anything was broken initally, I just noticed as debugging that it didn't strip out the actual title because of the Scenario keyword, newline, and space before it.

      Actual Code:
      RegexStoryParser line 151:

      String scenarioWithoutTitle = removeStart(scenarioAsText, title);

      Recommended Fix:
      String scenarioWithoutTitle = removeStart(scenarioAsText, keywords.scenario() + "\n " + title);

      Where "\n " can be replaced with whatever new line character is being used plus the space.

        Activity

        Mauro Talevi made changes -
        Field Original Value New Value
        Assignee Mauro Talevi [ maurotalevi ]
        Fix Version/s 3.6.7 [ 18494 ]
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Mauro Talevi made changes -
        Fix Version/s 3.7 [ 18390 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            David Tanner
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 5 minutes
              5m
              Remaining:
              Remaining Estimate - 5 minutes
              5m
              Logged:
              Time Spent - Not Specified
              Not Specified