diff options
Diffstat (limited to 'integration-tests/src/main')
-rw-r--r-- | integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt | 19 |
1 files changed, 13 insertions, 6 deletions
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<File> { - return this.walkTopDown().filter { it.isFile && it.extension == extension } - } + fun File.allDescendentsWithExtension(extension: String): Sequence<File> = + this.walkTopDown().filter { it.isFile && it.extension == extension } - fun File.allHtmlFiles(): Sequence<File> { - return allDescendentsWithExtension("html") - } + fun File.allHtmlFiles(): Sequence<File> = allDescendentsWithExtension("html") + + fun File.allGfmFiles(): Sequence<File> = allDescendentsWithExtension("md") protected fun assertContainsNoErrorClass(file: File) { val fileText = file.readText() @@ -103,4 +102,12 @@ abstract class AbstractIntegrationTest { "Unexpected empty <span></span> 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" + ) + } } |