Skip to content

Commit

Permalink
Fixed script context block
Browse files Browse the repository at this point in the history
  • Loading branch information
sksamuel committed Jan 31, 2021
1 parent 9fa5066 commit 8486e12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -20,7 +20,7 @@ fun test(name: String, test: suspend TestContext.() -> Unit) {
fun context(name: String, test: suspend ContextScope.() -> Unit) {
val testName = createTestName(name)
val description = ScriptSpec().description().append(testName, TestType.Container)
ScriptRuntime.registerRootTest(testName, false, TestType.Test) { ContextScope(description, it).test() }
ScriptRuntime.registerRootTest(testName, false, TestType.Container) { ContextScope(description, it).test() }
}

class ContextScope(
Expand Down
Expand Up @@ -113,9 +113,11 @@ class Discovery(private val discoveryExtensions: List<DiscoveryExtension> = empt

log("After discovery extensions there are ${filtered.size} spec classes")

val scriptsEnabled = System.getProperty(KotestEngineSystemProperties.scriptsEnabled) == "true" ||
System.getenv(KotestEngineSystemProperties.scriptsEnabled) == "true"

val scripts = when {
System.getProperty(KotestEngineSystemProperties.scriptsEnabled) == "true" -> discoverScripts()
System.getenv(KotestEngineSystemProperties.scriptsEnabled) == "true" -> discoverScripts()
scriptsEnabled -> discoverScripts()
else -> emptyList()
}

Expand Down

0 comments on commit 8486e12

Please sign in to comment.