aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test
diff options
context:
space:
mode:
authorBłażej Kardyś <bkardys@virtuslab.com>2020-10-18 23:04:26 +0200
committerBłażej Kardyś <bkardys@virtuslab.com>2020-11-09 14:56:24 +0100
commitbe80016c77e9b98a75d8e832dd5723737f0e1d72 (patch)
treed4a1124e9278fcfb3a1c1b00cf743d8553ded011 /plugins/base/src/test
parent1aba0ec4973d7915caa93f1e9b3146ad82111903 (diff)
downloaddokka-be80016c77e9b98a75d8e832dd5723737f0e1d72.tar.gz
dokka-be80016c77e9b98a75d8e832dd5723737f0e1d72.tar.bz2
dokka-be80016c77e9b98a75d8e832dd5723737f0e1d72.zip
Cleaning querying from plugins where possible
Diffstat (limited to 'plugins/base/src/test')
-rw-r--r--plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt12
-rw-r--r--plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt12
2 files changed, 7 insertions, 17 deletions
diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
index 7e8bde49..11896101 100644
--- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
+++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
@@ -1,15 +1,12 @@
package linkableContent
import org.jetbrains.dokka.SourceLinkDefinitionImpl
-import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.transformers.pages.samples.DefaultSamplesTransformer
import org.jetbrains.dokka.base.transformers.pages.sourcelinks.SourceLinksTransformer
-import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder
import org.jetbrains.dokka.model.WithGenerics
import org.jetbrains.dokka.model.dfs
import org.jetbrains.dokka.model.doc.Text
import org.jetbrains.dokka.pages.*
-import org.jetbrains.dokka.plugability.plugin
import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest
import org.jetbrains.kotlin.utils.addToStdlib.cast
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
@@ -127,14 +124,7 @@ class LinkableContentTest : AbstractCoreTest() {
testFromData(configuration) {
renderingStage = { rootPageNode, dokkaContext ->
- val newRoot = SourceLinksTransformer(
- dokkaContext,
- PageContentBuilder(
- dokkaContext.single(dokkaContext.plugin<DokkaBase>().commentsToContentConverter),
- dokkaContext.single(dokkaContext.plugin<DokkaBase>().signatureProvider),
- dokkaContext.logger
- )
- ).invoke(rootPageNode)
+ val newRoot = SourceLinksTransformer(dokkaContext).invoke(rootPageNode)
val moduleChildren = newRoot.children
Assertions.assertEquals(1, moduleChildren.size)
val packageChildren = moduleChildren.first().children
diff --git a/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt b/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt
index 2aba6d67..a3069107 100644
--- a/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt
+++ b/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt
@@ -10,9 +10,11 @@ import org.jetbrains.dokka.utilities.DokkaConsoleLogger
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
+import org.junit.jupiter.api.assertThrows
import testApi.testRunner.TestDokkaConfigurationBuilder
import testApi.testRunner.dModule
import testApi.testRunner.dPackage
+import java.lang.IllegalStateException
class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAndPackageDocumentationReaderTest() {
@@ -110,13 +112,11 @@ class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAnd
@Test
fun `assert moduleA with unknown source set`() {
- val documentation = reader[
- dModule("moduleA", sourceSets = setOf(configurationBuilder.unattachedSourceSet { name = "unknown" }))
- ]
- assertEquals(
- emptyMap<DokkaSourceSet, DocumentationNode>(), documentation,
+ assertThrows<IllegalStateException>(
"Expected no documentation received for module with unknown sourceSet"
- )
+ ) { reader[
+ dModule("moduleA", sourceSets = setOf(configurationBuilder.unattachedSourceSet { name = "unknown" }))
+ ]}
}
@Test