Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for delimited lists in step parameters #364

Closed
marquiswang opened this issue Jul 31, 2012 · 4 comments
Closed

Support for delimited lists in step parameters #364

marquiswang opened this issue Jul 31, 2012 · 4 comments

Comments

@marquiswang
Copy link

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.

@aslakhellesoy
Copy link
Contributor

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.

@daratha
Copy link

daratha commented Mar 9, 2018

Hi,
Is this feature implemented now in cucumber.

@mpkorstanje
Copy link
Contributor

@lock
Copy link

lock bot commented Mar 9, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants