JBehave

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.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: