diff --git a/src/main/kotlin/com/beust/kobalt/internal/SpekRunner.kt b/src/main/kotlin/com/beust/kobalt/internal/SpekRunner.kt new file mode 100644 index 00000000..c7d1c251 --- /dev/null +++ b/src/main/kotlin/com/beust/kobalt/internal/SpekRunner.kt @@ -0,0 +1,19 @@ +package com.beust.kobalt.internal + +import com.beust.kobalt.api.IAffinity +import com.beust.kobalt.api.IClasspathDependency +import com.beust.kobalt.api.KobaltContext +import com.beust.kobalt.api.Project + +public class SpekRunner() : GenericTestRunner() { + + override val mainClass = "org.junit.runner.JUnitCore" + + override fun affinity(project: Project, context: KobaltContext) = + if (project.testDependencies.any { it.id.contains("org.jetbrains.spek")})IAffinity.DEFAULT_POSITIVE_AFFINITY + else 0 + + override fun args(project: Project, classpath: List) = findTestClasses(project, classpath) + +} + diff --git a/src/main/resources/META-INF/kobalt-plugin.xml b/src/main/resources/META-INF/kobalt-plugin.xml index ca48fd11..cadfc4a4 100644 --- a/src/main/resources/META-INF/kobalt-plugin.xml +++ b/src/main/resources/META-INF/kobalt-plugin.xml @@ -17,9 +17,10 @@ com.beust.kobalt.app.java.JavaBuildGenerator com.beust.kobalt.app.kotlin.KotlinBuildGenerator - + com.beust.kobalt.internal.JUnitRunner com.beust.kobalt.internal.TestNgRunner + com.beust.kobalt.internal.SpekRunner \ No newline at end of file