From c63ea36637ce956029fb15b1482c0683ecb8a587 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Wed, 30 Aug 2023 15:58:46 +0200 Subject: Migrate to JUnit 5 and unify used test API (#3138) --- .../templates/MultiModuleDocumentationTest.kt | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'plugins/all-modules-page/src/test/kotlin/templates/MultiModuleDocumentationTest.kt') diff --git a/plugins/all-modules-page/src/test/kotlin/templates/MultiModuleDocumentationTest.kt b/plugins/all-modules-page/src/test/kotlin/templates/MultiModuleDocumentationTest.kt index 525331fc..a92fa115 100644 --- a/plugins/all-modules-page/src/test/kotlin/templates/MultiModuleDocumentationTest.kt +++ b/plugins/all-modules-page/src/test/kotlin/templates/MultiModuleDocumentationTest.kt @@ -6,37 +6,37 @@ import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.pages.ContentKind import org.jetbrains.dokka.pages.ContentResolvedLink import org.jetbrains.dokka.pages.MultimoduleRootPageNode -import org.junit.Rule -import org.junit.jupiter.api.AfterEach -import org.junit.jupiter.api.BeforeEach -import org.junit.jupiter.api.Test -import org.junit.rules.TemporaryFolder +import org.junit.jupiter.api.io.TempDir +import java.io.File +import kotlin.test.AfterTest +import kotlin.test.BeforeTest +import kotlin.test.Test import kotlin.test.assertEquals class MultiModuleDocumentationTest : MultiModuleAbstractTest() { - @get:Rule - val folder: TemporaryFolder = TemporaryFolder() + + @field:TempDir + lateinit var tempDir: File val documentationContent = """ # Sample project Sample documentation with [external link](https://www.google.pl) """.trimIndent() - @BeforeEach + @BeforeTest fun setup() { - folder.create() - folder.root.resolve("README.md").writeText(documentationContent) + tempDir.resolve("README.md").writeText(documentationContent) } - @AfterEach + @AfterTest fun teardown(){ - folder.root.resolve("README.md").delete() + tempDir.resolve("README.md").delete() } @Test fun `documentation should be included in all modules page`() { val configuration = dokkaConfiguration { - includes = listOf(folder.root.resolve("README.md")) + includes = listOf(tempDir.resolve("README.md")) } testFromData(configuration) { -- cgit