aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/utils
diff options
context:
space:
mode:
authorPaweł Marks <pmarks@virtuslab.com>2020-03-02 17:10:16 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-03-04 14:28:14 +0100
commit973cc5238e2f7ede6d9cf54437785770a3e020c9 (patch)
treea1e3e9176c37b33a4c900b3abf1f23f501b05931 /plugins/base/src/test/kotlin/utils
parent1347329aa18203e9657e096447e0e30ae759b137 (diff)
downloaddokka-973cc5238e2f7ede6d9cf54437785770a3e020c9.tar.gz
dokka-973cc5238e2f7ede6d9cf54437785770a3e020c9.tar.bz2
dokka-973cc5238e2f7ede6d9cf54437785770a3e020c9.zip
Tests for wrapping groups in renderer. Also util for groups
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 ***", "")
}