Details

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

      Description

      Can you please support inline comments like in the example below?

      Examples:
      |accountNr               |city   |
      |123 !-- private customer|Zuerich|
      |312                     |Zuerich|
      |999 !-- company customer|Basel  |
      

      The above example does not work, neither with !-- nor with |--.

      As it seems, comments can only start on a new line in JBehave. So a workaround would be:

      Examples:
      |accountNr               |city   |
      !-- private customer
      |123                     |Zuerich|
      |312                     |Zuerich|
      !-- company customer
      |999                     |Basel  |
      

      But this is not so readable as the inline comments since it destroys the layout of the example table quite a bit.

        Activity

        Mauro Talevi made changes -
        Field Original Value New Value
        Assignee Mauro Talevi [ maurotalevi ]
        Fix Version/s 3.9 [ 19035 ]
        Hide
        Mauro Talevi added a comment -

        Supported via inline comment separator:

        Examples:
        {commentSeparator=#}
        |accountNr            |city   |
        |123 #private customer|Zuerich|
        |312                  |Zuerich|
        |999 #company customer|Basel  |
        
        Show
        Mauro Talevi added a comment - Supported via inline comment separator: Examples: {commentSeparator=#} |accountNr |city | |123 # private customer|Zuerich| |312 |Zuerich| |999 #company customer|Basel |
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Otto Diesel added a comment -

        Great! Thank you! I will test that when we use the fix version. Currently we are working on JBehave 3.8 and 4.0-beta3.

        Show
        Otto Diesel added a comment - Great! Thank you! I will test that when we use the fix version. Currently we are working on JBehave 3.8 and 4.0-beta3.
        Hide
        Mauro Talevi added a comment -

        Sure, will be pushing out new betas shortly.

        Show
        Mauro Talevi added a comment - Sure, will be pushing out new betas shortly.
        Hide
        Mauro Talevi added a comment -

        Hi Otto, please try out latest 3.9-beta-3.

        Show
        Mauro Talevi added a comment - Hi Otto, please try out latest 3.9-beta-3.
        Hide
        Otto Diesel added a comment - - edited

        I tested it with 3.9-beta3 today.

        It works, but there is a little issue. If we take the example above, the value '123 ' is passed instead of a trimmed '123' value. A workaround is to use the comment like |123#private customer|. But I would prefer if JBehave would trim it until the comment starts. What do you think?

        By the way, this workaround did not work in order to use inline comments like '123 #my comment':

        {commentSeparator= #}

        .
        I wonder a bit why the comment separator has to be declared in a story file. This looks a bit too technical for a story file I think. But I understand why you did it like this. Otherwise sometimes escape characters would be required, which you did not want as it seems.

        A nice feature would be if the JBehave editor in Eclipse (jbehave-eclipse) would consider this inline comments and print them in green like the other comments.

        Show
        Otto Diesel added a comment - - edited I tested it with 3.9-beta3 today. It works, but there is a little issue. If we take the example above, the value '123 ' is passed instead of a trimmed '123' value. A workaround is to use the comment like |123#private customer|. But I would prefer if JBehave would trim it until the comment starts. What do you think? By the way, this workaround did not work in order to use inline comments like '123 #my comment': {commentSeparator= #} . I wonder a bit why the comment separator has to be declared in a story file. This looks a bit too technical for a story file I think. But I understand why you did it like this. Otherwise sometimes escape characters would be required, which you did not want as it seems. A nice feature would be if the JBehave editor in Eclipse (jbehave-eclipse) would consider this inline comments and print them in green like the other comments.
        Hide
        Mauro Talevi added a comment -

        Thanks for testing. The trimming should be the default. It has been fixed and will be available in the next release.

        The comments in the table values are a rather specific use case, and using inline property allows the user to specify the comment separator of preference. Using | would not work as it would be mistaken for a column separator, while !-- seemed less readable (but you can configure it you prefer).

        Let's see how this works and we can do an enhancement later on, if needed.

        Show
        Mauro Talevi added a comment - Thanks for testing. The trimming should be the default. It has been fixed and will be available in the next release. The comments in the table values are a rather specific use case, and using inline property allows the user to specify the comment separator of preference. Using | would not work as it would be mistaken for a column separator, while !-- seemed less readable (but you can configure it you prefer). Let's see how this works and we can do an enhancement later on, if needed.

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Otto Diesel
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: