cucumber/cucumber-jvm — Issue #85: GroovyBackend Broken?
Author: hauner
Created: 2011-11-05 11:57:57+00:00
State: open

Hi, I'm building a grails plugin (https://github.com/hauner/grails-cucumber) based on the cucumber-jvm cli code and it looks like there is a problem in the GrovvyBackend.

As far as I understand the code core/Runtime is finally calling core/World to run steps. Problem is that the GroovyBackend does not add the steps to the World but to an instance of itself.

from GroovyBackend:

public static void addStepDefinition(Pattern regexp, Closure body) {
instance.stepDefinitions.add(new GroovyStepDefinition(regexp, body, stepDefLocation(), instance));
}

Changing this to the following code runs steps again...

public static void addStepDefinition(Pattern regexp, Closure body) {
instance.world.addStepDefinition (new GroovyStepDefinition(regexp, body, stepDefLocation(), instance));
}

but crashes for me after a couple of steps in GroovyBackend.stepDefLocation () with a NullPointerException.

Not sure if I'm completely off track here or if it is worth to further analyze it?