Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using NoSystemOutListener prevents single tests from being executed (#…
- Loading branch information
Showing
2 changed files
with
74 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 30 additions & 30 deletions
60
...t-extensions/src/jvmTest/kotlin/com/sksamuel/kt/extensions/system/NoSystemOutOrErrTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
//package com.sksamuel.kt.extensions.system | ||
// | ||
//import io.kotest.assertions.throwables.shouldThrow | ||
//import io.kotest.core.annotation.Isolate | ||
//import io.kotest.extensions.system.NoSystemErrListener | ||
//import io.kotest.extensions.system.NoSystemOutListener | ||
//import io.kotest.extensions.system.SystemErrWriteException | ||
//import io.kotest.extensions.system.SystemOutWriteException | ||
//import io.kotest.core.spec.style.StringSpec | ||
// | ||
//@Isolate | ||
//class NoSystemOutOrErrTest : StringSpec() { | ||
// | ||
// override fun listeners() = listOf(NoSystemOutListener, NoSystemErrListener) | ||
// | ||
// init { | ||
// | ||
// "System.out should throw an exception when the listener is added" { | ||
// shouldThrow<SystemOutWriteException> { | ||
// println("boom") | ||
// } | ||
// } | ||
// | ||
// "System.err should throw an exception when the listener is added" { | ||
// shouldThrow<SystemErrWriteException> { | ||
// System.err.println("boom") | ||
// } | ||
// } | ||
// } | ||
//} | ||
package com.sksamuel.kt.extensions.system | ||
|
||
import io.kotest.assertions.throwables.shouldThrow | ||
import io.kotest.core.annotation.Isolate | ||
import io.kotest.extensions.system.NoSystemErrListener | ||
import io.kotest.extensions.system.NoSystemOutListener | ||
import io.kotest.extensions.system.SystemErrWriteException | ||
import io.kotest.extensions.system.SystemOutWriteException | ||
import io.kotest.core.spec.style.StringSpec | ||
|
||
@Isolate | ||
class NoSystemOutOrErrTest : StringSpec() { | ||
|
||
override fun listeners() = listOf(NoSystemOutListener, NoSystemErrListener) | ||
|
||
init { | ||
|
||
"System.out should throw an exception when the listener is added" { | ||
shouldThrow<SystemOutWriteException> { | ||
println("boom") | ||
} | ||
} | ||
|
||
"System.err should throw an exception when the listener is added" { | ||
shouldThrow<SystemErrWriteException> { | ||
System.err.println("boom") | ||
} | ||
} | ||
} | ||
} |