试图弄清楚这个geb和spock测试框架并遇到一些问题。现在我只是在努力让 spock 工作。
@Grab(group='org.codehaus.geb', module='geb-core', version='0.7.2')
@Grab(group='org.seleniumhq.selenium', module='selenium-firefox-driver', version='2.31.0')
@Grab(group='org.spockframework', module='spock-core', version='0.6-groovy-1.7')
@Grab(group='org.codehaus.groovy', module='groovy-all', version='1.8.6')
import geb.*
import org.openqa.selenium.firefox.FirefoxDriver
import spock.lang.*
class TestSimpleGoogle extends Specification {
def "pushing an element on the stack"() {
when: "A variable is defined"
title = "Hello"
then: "Check to see if it equals hello"
assert(title == "Hello")
}
}
这是我从命令终端得到的输出
Caught: java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.InvokerHelper.getVersion()Ljava/lang/String;
java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.InvokerHelper.getVersion()Ljava/lang/String;
at org.spockframework.util.GroovyReleaseInfo.getVersion(GroovyReleaseInfo.java:23)
at org.spockframework.util.VersionChecker.<clinit>(VersionChecker.java:18)
at org.spockframework.compiler.SpockTransform.<init>(SpockTransform.java:43)
想法?