Support for delimited lists in step parameters #364

marquiswang opened this Issue Jul 31, 2012 · 1 comment

2 participants


I have use cases for steps where I list a set of enums to pass into a step. For a simple example:

Given there are walls to the EAST, WEST, NORTH
And I look for directions to move
Then I can move to the SOUTH

I would like to be able to use a step like:

@Given("^there are walls to the ([A-Z]+(?:, [A-Z]+)*)$")
public void wallsToThe(@Delimiter(", ") Collection<Direction> dirs)

What I've done for now is to create a Directions class that extends ForwardingCollection and a DirectionsConverter, but it would be nice if there was native support for a Collection converter.

Basically, I'm asking if there is a better way to do something like this, and if not if such a feature would be acceptable if I submitted a pull request.

Cucumber member

That sounds like a nice feature. If @Delimiter is not specified I think it should default to ,. I'd be happy to take a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment