Skip to content

Commit

Permalink
Fixing test that was broken after previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kantis committed May 18, 2023
1 parent 1b59953 commit b77e317
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import io.kotest.core.config.ProjectConfiguration
import io.kotest.core.extensions.TagExtension
import io.kotest.core.spec.style.StringSpec
import io.kotest.engine.TestEngineLauncher
import io.kotest.engine.extensions.SpecifiedTagsTagExtension
import io.kotest.engine.listener.CollectingTestEngineListener
import io.kotest.matchers.shouldBe

Expand All @@ -14,7 +15,11 @@ class TagExtensionTest : StringSpec() {
init {
"tag extensions should be used when calculating runtime tags" {

val c = ProjectConfiguration().apply { registry.add(TagExtension { TagExpression("!SpecExcluded") }) }
val c = ProjectConfiguration().apply {
registry.add(TagExtension { TagExpression(setOf(TagA), setOf(TagB)) })
registry.add(SpecifiedTagsTagExtension(TagExpression("!SpecExcluded")))
}

val collector = CollectingTestEngineListener()
TestEngineLauncher(collector)
.withClasses(TestWithTags::class)
Expand All @@ -36,14 +41,10 @@ object TagB : Tag()

private class TestWithTags : StringSpec() {
init {
extension(ext)

"should be tagged with tagA and therefore included".config(tags = setOf(TagA)) { }

"should be untagged and therefore excluded" { }

"should be tagged with tagB and therefore excluded".config(tags = setOf(TagB)) { }
}
}

private val ext = TagExtension { TagExpression(setOf(TagA), setOf(TagB)) }

0 comments on commit b77e317

Please sign in to comment.