Hello,
I’m trying to emulate basic Fitnesse behaviour based on Spock/Geb. I have a problem when running the tests:
Wiki.WikiTest > initializationError FAILED >
java.lang.ClassNotFoundException: Wiki.WikiTest
Here’s the code that probably contains the error:
}configurations {
wikiTest.extendsFrom compile
wikiTest.each { println it.name }
}
sourceSets {
wikiTest { groovy.srcDirs 'src/test/generated' }
}
def codeGeneratingCopySpec = copySpec {
from 'src/test/resources'
include 'generic-spec.groovy.template'
rename '.*', 'WikiTest.groovy'
}
task generateGroovyCodeFromWikiSpec(dependsOn: gatherSingleSpecFromWiki) {
ext { spec = null }
doFirst {
spec = gatherSingleSpecFromWiki.spec
codeGeneratingCopySpec.expand 'testMethodContent': spec
}
doLast {
copy {
with codeGeneratingCopySpec
into 'src/test/generated/Wiki'
}
}
compileWikiTestGroovy.groovyClasspath = compileGroovy.groovyClasspath
compileWikiTestGroovy.classpath = configurations.testCompile + sourceSets.main.output
compileWikiTestGroovy.dependsOn it
}
task wikiTest(type: Test) {
dependsOn compileWikiTestGroovy
testClassesDir
= sourceSets.wikiTest.output.classesDir
testSrcDirs
= sourceSets.wikiTest.groovy.srcDirs as List<File>
}
The code does get compiled however, and the outputDir is
build/classes/wikiTest
as expected