JBehave
  1. JBehave
  2. JBEHAVE-211

StringListConverter converts an empty String to a one element List instead of an empty List

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 2.4
    • Component/s: Core
    • Labels:
      None
    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      Given a textual step:

      Then string is ''
      

      the following test will fail:

      @Then("string is '$params'")
      public void empty(List<String> params) {
          ensureThat(params.isEmpty(), equalTo(true));
      }
      

      A more likely scenario would be a table example:

      Scenario: <Guess> marks as <Mark>
          Given the secret r,g,y,b
          When I guess [Guess]
          Then I should get [Mark]
      
        Examples:
          |Guess|Mark|
          |c,c,c,c||
          |b,c,c,c|m|
      

      where the first row would fail if Mark were compared to an empty List.

        Activity

        Hide
        Mauro Talevi added a comment -

        Thanks Cyril. I'll apply patch and release it in 2.4.

        Show
        Mauro Talevi added a comment - Thanks Cyril. I'll apply patch and release it in 2.4.
        Mauro Talevi made changes -
        Field Original Value New Value
        Assignee Mauro Talevi [ maurotalevi ]
        Fix Version/s 2.4 [ 15664 ]
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Cyril Ledru
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: