Upgraded to 4.2.0. The following Spec now runs despite being tagged not to run:
import io.kotest.assertions.fail
import io.kotest.core.Tag
import io.kotest.core.Tags
import io.kotest.core.config.AbstractProjectConfig
import io.kotest.core.extensions.TagExtension
import io.kotest.core.spec.style.StringSpec
object Exclude : Tag()
object ExcludeTagExtension : TagExtension {
override fun tags(): Tags = Tags.exclude(Exclude)
}
@Suppress("unused") // read by reflection
object ProjectConfig : AbstractProjectConfig() {
override fun extensions() = listOf(ExcludeTagExtension)
}
class ExcludedSpec : StringSpec({
tags(Exclude)
"should not run" {
fail("Shouldn't get here")
}
})
I've fixed this in master so will be in 4.2.1
I've also updated the plugin so that
object ProjectConfig : AbstractProjectConfig() {
override fun extensions() = listOf(ExcludeTagExtension)
}
will be marked as used so you won't need the
@Suppress("unused") // read by reflection
in future
4.2.1 is released.