Hi everyone,
Wouldn't it be nice to use Java 8 closures for step definitions and hooks?
Given("I have (\\d+) cukes in my (.*)", (Integer cukes, String what) -> {
assertEquals(42, cukes.intValue());
assertEquals("belly", what);
});
Well, we're pretty close to that on the java8 branch of cucumber-jvm.
There is one annoying thing with the current implementation - we don't have state isolation yet. What this means is that several scenarios won't have isolated state. This is obviously no good, so I'm hoping the community can help.
I like illustrating problems with a failing scenario, and here it is:
This lives on the java8-state branch.
Any suggestions how we can deal with this? Any smart hacks? Should we design the API differently?
Aslak