I've been reading the older posts and this code which constructs a closure
works.
It evalutes this line of code.
bootStrap '//*[@id=\"pane\"]'
public Object runInContext(Object context, String script, GroovyShell
shell) {
Closure cl = (Closure) shell.evaluate("{->" + script + "}");
I mean that this works if the DSL command is hard-coded. I was trying to
pass it into the shell.
Am I allowed to pass it into the shell ? This evaluation is generic for
many such fluent commands.
def evaluatexpath( String dsl ){
def binding = new Binding(
dxp: new DynamicXPath(),
Hi,
I am reading the book 'Groovy in Action' and this code is based on
that.
My base script stores 'DynamicXPath' like this.
abstract class AxesBaseScript extends Script {
public DynamicXPath bootStrap(String initialPath ){
this.binding.dxp.bootStrap initialPath
}
}
And h