From fea7c42733a339ed19fc7471bb064f53de71cc6b Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Thu, 17 Dec 2020 12:14:40 +0100 Subject: Multimodule tests (#1670) * Multimodule tests * Multimodule tests --- .../org/jetbrains/dokka/it/AbstractIntegrationTest.kt | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'integration-tests/src/main/kotlin/org/jetbrains/dokka') diff --git a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt index 7c08b534..a47adbc4 100644 --- a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt +++ b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt @@ -18,13 +18,12 @@ abstract class AbstractIntegrationTest { val projectDir get() = File(temporaryTestFolder.root, "project") - fun File.allDescendentsWithExtension(extension: String): Sequence { - return this.walkTopDown().filter { it.isFile && it.extension == extension } - } + fun File.allDescendentsWithExtension(extension: String): Sequence = + this.walkTopDown().filter { it.isFile && it.extension == extension } - fun File.allHtmlFiles(): Sequence { - return allDescendentsWithExtension("html") - } + fun File.allHtmlFiles(): Sequence = allDescendentsWithExtension("html") + + fun File.allGfmFiles(): Sequence = allDescendentsWithExtension("md") protected fun assertContainsNoErrorClass(file: File) { val fileText = file.readText() @@ -103,4 +102,12 @@ abstract class AbstractIntegrationTest { "Unexpected empty in file ${file.path}" ) } + + protected fun assertNoUnsubstitutedTemplatesInHtml(file: File) { + val parsedFile = Jsoup.parse(file, "UTF-8") + assertTrue( + parsedFile.select("dokka-template-command").isEmpty(), + "Expected all templates to be substituted" + ) + } } -- cgit