From c24e9b5b0f0ac9a80ff36282fe708e4ee0ecf707 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Tue, 1 Sep 2020 09:54:41 +0200 Subject: Implement exitGenerationGracefully API --- .../basic/AbortGracefullyOnMissingDocumentablesTest.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 plugins/base/src/test/kotlin/basic/AbortGracefullyOnMissingDocumentablesTest.kt (limited to 'plugins/base/src/test') diff --git a/plugins/base/src/test/kotlin/basic/AbortGracefullyOnMissingDocumentablesTest.kt b/plugins/base/src/test/kotlin/basic/AbortGracefullyOnMissingDocumentablesTest.kt new file mode 100644 index 00000000..0262760d --- /dev/null +++ b/plugins/base/src/test/kotlin/basic/AbortGracefullyOnMissingDocumentablesTest.kt @@ -0,0 +1,18 @@ +package basic + +import org.jetbrains.dokka.DokkaGenerator +import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest +import org.junit.jupiter.api.Test +import kotlin.test.assertTrue + +class AbortGracefullyOnMissingDocumentablesTest: AbstractCoreTest() { + @Test + fun `Generation aborts Gracefully with no Documentables`() { + DokkaGenerator(dokkaConfiguration { }, logger).generate() + + assertTrue( + logger.progressMessages.any { message -> "Exiting Generation: Nothing to document" == message }, + "Expected graceful exit message. Found: ${logger.progressMessages}" + ) + } +} -- cgit