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

Feature: automatically convert data tables to lists of enums just as is done with classes #346

Closed
newmanne opened this issue Jun 14, 2012 · 4 comments

Comments

@newmanne
Copy link

Let's say I have a test that reads:

Then I see these colors:
  | color |
  | RED |
  | YELLOW |
  | BLUE |

and I have an enum that reads

public static enum Color {
        RED, YELLOW, BLUE
}

then in the step definition I want to do something like:

@Then("^I see the following colors$")
public void I_see_the_following_colors(List<Color> colors) {
}

Currently I get:

cucumber.runtime.CucumberException: Can't assign null value to one of the primitive fields in com.Color ColorStepDefinitions$color. Please use boxed types.

It would be great if the behavior would mimic what is being done for classes, as in the shopping cart example in hello world and just do the conversion for me.

@aslakhellesoy
Copy link
Contributor

Fixing this might be related to #320.

aslakhellesoy added a commit that referenced this issue Jun 15, 2012
@aslakhellesoy
Copy link
Contributor

In order for this to work we'd probably have to skip the header:

Then I see these colors:
  | RED    |
  | YELLOW |
  | BLUE   |

@aslakhellesoy
Copy link
Contributor

This is fixed in 1.0.10

@lock
Copy link

lock bot commented Oct 25, 2018

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 Oct 25, 2018
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

2 participants