我想做类似的事情:
class MySpec extends Specification with BeforeAfterExample {
var testName
var clientDir
def before {
testName = fragmentName.replaceAll(" ", "-")
clientDir = new File(workspaceRoot, testName)
clientDir.mkdirs()
}
def after {
FileUtils.deleteDirectory(clientDir)
}
}