diff --git a/src/test/kotlin/ktee/KTeeTest.kt b/src/test/kotlin/ktee/KTeeTest.kt index 5502a0b..b9d47d0 100644 --- a/src/test/kotlin/ktee/KTeeTest.kt +++ b/src/test/kotlin/ktee/KTeeTest.kt @@ -4,7 +4,6 @@ import org.slf4j.Logger import org.slf4j.LoggerFactory import kotlin.test.Test import kotlin.test.assertEquals -import kotlin.test.assertFailsWith import kotlin.test.assertTrue class KTeeTest { @@ -65,60 +64,4 @@ class KTeeTest { outputs.forEach { assertTrue { it.endsWith("hello myval" + System.lineSeparator()) } } } - @Test - fun `should throw IllegalStateException`() { - assertFailsWith { - KTee.debug = false; KTee.debug = false } - } - - @Test - fun `should not write to stdout`() { - if (!KTee.debugChanged) KTee.debug = false - assertEquals("", trapOut { "myval".tee() }) - } - - @Test - fun `should not evaluate lambda or write to stdout`() { - if (!KTee.debugChanged) KTee.debug = false - assertEquals("", trapOut { "myval".tee { v -> "value is $v" } }) - } - - @Test - fun `should not write to logger`() { - if (!KTee.debugChanged) KTee.debug = false - assertTrue(trapErr { "myval".teeToInfo(logger) } == "") - } - - @Test - fun `should not log with info level`() { - if (!KTee.debugChanged) KTee.debug = false - val outputs = listOf( - trapErr { "myval".teeToInfo(logger, "hello {}") }, - trapErr { "myval".teeToInfo(logger) { "hello $it" } }, - trapErr { "myval".teeToInfo(logger) { "hello {}" } } - ) - outputs.forEach { assertTrue { !it.contains("INFO") } } - } - - @Test - fun `should not log with trace level`() { - if (!KTee.debugChanged) KTee.debug = false - val outputs = listOf( - trapErr { "myval".teeToTrace(logger, "hello {}") }, - trapErr { "myval".teeToTrace(logger) { "hello $it" } }, - trapErr { "myval".teeToTrace(logger) { "hello {}" } } - ) - outputs.forEach { assertTrue { it == "" } } - } - - @Test - fun `should not log with debug level`() { - if (!KTee.debugChanged) KTee.debug = false - val outputs = listOf( - trapErr { "myval".teeToDebug(logger, "hello {}") }, - trapErr { "myval".teeToDebug(logger) { "hello $it" } }, - trapErr { "myval".teeToDebug(logger) { "hello {}" } } - ) - outputs.forEach { assertTrue { !it.contains("DEBUG") } } - } }