Add test class suffix generation
No tests due to broken windows theory...
This commit is contained in:
@@ -51,7 +51,8 @@ class TestGenerator {
|
||||
if (containsStubs(it)) {
|
||||
def testBaseDir = Paths.get(targetDirectory, NamesUtil.packageToDirectory(packageName))
|
||||
Files.createDirectories(testBaseDir)
|
||||
def classPath = Paths.get(testBaseDir.toString(), capitalize(it.name) + getTestClassExtension()).toAbsolutePath()
|
||||
def classPath = Paths.get(testBaseDir.toString(), capitalize(it.name) + getTestClassSuffix() + getTestClassExtension())
|
||||
.toAbsolutePath()
|
||||
def classBytes = buildClass(it, packageName).bytes
|
||||
Files.write(classPath, classBytes, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)
|
||||
counter.incrementAndGet()
|
||||
@@ -60,6 +61,10 @@ class TestGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
private String getTestClassSuffix() {
|
||||
return configProperties.targetFramework == TestFramework.SPOCK ? 'Spec' : 'Test'
|
||||
}
|
||||
|
||||
private String getTestClassExtension() {
|
||||
return configProperties.targetFramework == TestFramework.SPOCK ? '.groovy' : '.java'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user