package com.beust.kobalt.internal

import com.beust.kobalt.api.KobaltContext
import com.beust.kobalt.api.Project

/**
 * KotlinTestRunner triggers if it finds a dependency on io.kotlintest but other than that, it just
 * uses the regular JUnitRunner.
 */
class KotlinTestRunner : JUnitRunner() {
    override val dependencyName = "io.kotlintest"
    override val runnerName = "Kotlin Test"

    /**
     * KotlinTestRunner runs tests in the init{} initializer, so ignore all the extra
     * classes generated by the Kotlin compiler.
     */
    override fun filterTestClasses(projet: Project, context: KobaltContext, classes: List<String>)
            = classes.filter { !it.contains("$") }
}

