Cucumber JVM: How do I use a double as an input value?

user321605 picture user321605 · Feb 15, 2013 · Viewed 10.6k times · Source

For a Behavior test that I'm trying to write, I require inputs that are floating point. How do I set up my gherkin string to look for these values?

Answer

denis.solonenko picture denis.solonenko · Feb 27, 2013

Simple (.+) should work

Given I have a floating point 1.2345 number

@Given("^I have a floating point (.+) number$")
public void I_have_a_floating_point_number(double arg) throws Throwable { 
    ... 
}