aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/utils
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/test/kotlin/utils')
-rw-r--r--plugins/base/src/test/kotlin/utils/TestOutputWriter.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/base/src/test/kotlin/utils/TestOutputWriter.kt b/plugins/base/src/test/kotlin/utils/TestOutputWriter.kt
index 43161929..e2250a26 100644
--- a/plugins/base/src/test/kotlin/utils/TestOutputWriter.kt
+++ b/plugins/base/src/test/kotlin/utils/TestOutputWriter.kt
@@ -5,23 +5,23 @@ import org.jetbrains.dokka.base.renderers.OutputWriter
import org.jetbrains.dokka.plugability.DokkaPlugin
import java.io.File
-class TestOutputWriterPlugin(failOnOverwrite: Boolean): DokkaPlugin() {
+class TestOutputWriterPlugin(failOnOverwrite: Boolean = true): DokkaPlugin() {
private val writer = TestOutputWriter(failOnOverwrite)
val testWriter by extending { plugin<DokkaBase>().outputWriter with writer }
}
-class TestOutputWriter(private val failOnOverwrite: Boolean): OutputWriter {
+class TestOutputWriter(private val failOnOverwrite: Boolean = true): OutputWriter {
val contents: Map<String, String> get() = _contents
private val _contents = mutableMapOf<String, String>()
override fun write(path: String, text: String, ext: String) {
- val fullPath = listOf(path, ext).joinToString(separator = ".")
+ val fullPath = "$path$ext"
_contents.putIfAbsent(fullPath, text)?.also {
if (failOnOverwrite) throw AssertionError("File $fullPath is being overwritten.")
}
}
- override fun writeResources(pathFrom: String, pathTo: String) = write(pathFrom, File(pathTo).readText(), "")
+ override fun writeResources(pathFrom: String, pathTo: String) = write(pathTo, "*** content of $pathFrom ***", "")
}