-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c0fe5e
commit 1e90cfc
Showing
12 changed files
with
228 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
version: '0.15.2' | ||
--- | ||
|
||
- Updates dependency versions |
14 changes: 14 additions & 0 deletions
14
OrchidCore/src/test/java/com/eden/orchid/testhelpers/TestHomepageModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.eden.orchid.testhelpers; | ||
|
||
import com.eden.orchid.api.generators.OrchidGenerator; | ||
import com.eden.orchid.api.registration.OrchidModule; | ||
import com.eden.orchid.impl.generators.HomepageGenerator; | ||
|
||
public class TestHomepageModule extends OrchidModule { | ||
|
||
@Override | ||
protected void configure() { | ||
addToSet(OrchidGenerator.class, HomepageGenerator.class); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,9 @@ compileKotlin { | |
kotlinOptions { | ||
jvmTarget = '1.8' | ||
} | ||
} | ||
compileTestKotlin { | ||
kotlinOptions { | ||
jvmTarget = '1.8' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
dependencies { | ||
implementation 'org.asciidoctor:asciidoctorj:1.5.7' | ||
implementation 'org.asciidoctor:asciidoctorj:1.6.0' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
...ensions/OrchidAsciidoc/src/test/kotlin/com/eden/orchid/languages/asciidoc/AsciidocTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package com.eden.orchid.languages.asciidoc | ||
|
||
import com.eden.orchid.testhelpers.OrchidIntegrationTest | ||
import com.eden.orchid.testhelpers.TestHomepageModule | ||
import com.eden.orchid.testhelpers.asHtml | ||
import com.eden.orchid.testhelpers.innerHtml | ||
import com.eden.orchid.testhelpers.matches | ||
import com.eden.orchid.testhelpers.pageWasRendered | ||
import com.eden.orchid.testhelpers.select | ||
import org.junit.jupiter.api.DisplayName | ||
import org.junit.jupiter.api.Test | ||
import strikt.api.expectThat | ||
import strikt.assertions.isEqualTo | ||
|
||
@DisplayName("Tests behavior of using Asciidoc for the homepage") | ||
class AsciidocTest : OrchidIntegrationTest(TestHomepageModule()) { | ||
|
||
@Test | ||
@DisplayName("Test that Markdown works normally") | ||
fun test01() { | ||
resource("homepage.md", | ||
""" | ||
|**Markdown Page** | ||
""".trimMargin() | ||
) | ||
|
||
val testResults = execute() | ||
expectThat(testResults) | ||
.pageWasRendered("//index.html") | ||
.get { content } | ||
.asHtml(true) | ||
.select("body") | ||
.matches() | ||
.innerHtml() | ||
.isEqualTo( | ||
""" | ||
|<p> | ||
| <strong>Markdown Page</strong> | ||
|</p> | ||
""".trimMargin() | ||
) | ||
} | ||
|
||
@Test | ||
@DisplayName("Test that Asciidoc syntax is not supported when the module is not included. Homepage file will not be found at all.") | ||
fun test02() { | ||
resource("homepage.ad", | ||
""" | ||
|**Unknown Asciidoc Page** | ||
""".trimMargin() | ||
) | ||
|
||
val testResults = execute() | ||
expectThat(testResults) | ||
.pageWasRendered("//index.html") | ||
.get { content } | ||
.asHtml(true) | ||
.select("body") | ||
.matches() | ||
.innerHtml() | ||
.isEqualTo("") | ||
} | ||
|
||
@Test | ||
@DisplayName("Test that Asciidoc syntax works when the file ends with .ad when the module is included") | ||
fun test03() { | ||
resource("homepage.ad", | ||
""" | ||
|**Asciidoc Page** | ||
""".trimMargin() | ||
) | ||
|
||
val testResults = execute(AsciidocModule()) | ||
expectThat(testResults) | ||
.pageWasRendered("//index.html") | ||
.get { content } | ||
.asHtml(true) | ||
.select("body") | ||
.matches() | ||
.innerHtml() | ||
.isEqualTo( | ||
""" | ||
|<div class="paragraph"> | ||
| <p> | ||
| <strong>Asciidoc Page</strong> | ||
| </p> | ||
|</div> | ||
""".trimMargin() | ||
) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
dependencies { | ||
implementation 'net.sourceforge.plantuml:plantuml:1.2018.11' | ||
implementation 'net.sourceforge.plantuml:plantuml:1.2018.14' | ||
} |
78 changes: 78 additions & 0 deletions
78
...ensions/OrchidDiagrams/src/test/kotlin/com/eden/orchid/languages/diagrams/DiagramsTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package com.eden.orchid.languages.diagrams | ||
|
||
import com.eden.orchid.testhelpers.OrchidIntegrationTest | ||
import com.eden.orchid.testhelpers.TestHomepageModule | ||
import com.eden.orchid.testhelpers.asHtml | ||
import com.eden.orchid.testhelpers.innerHtml | ||
import com.eden.orchid.testhelpers.matches | ||
import com.eden.orchid.testhelpers.pageWasRendered | ||
import com.eden.orchid.testhelpers.select | ||
import org.junit.jupiter.api.DisplayName | ||
import org.junit.jupiter.api.Test | ||
import strikt.api.expectThat | ||
import strikt.assertions.isEqualTo | ||
|
||
@DisplayName("Tests behavior of using Asciidoc for the homepage") | ||
class DiagramsTest : OrchidIntegrationTest(TestHomepageModule()) { | ||
|
||
@Test | ||
@DisplayName("Test that Markdown works normally") | ||
fun test01() { | ||
resource("homepage.md", | ||
""" | ||
|Bob->Alice : hello | ||
""".trimMargin() | ||
) | ||
|
||
val testResults = execute() | ||
expectThat(testResults) | ||
.pageWasRendered("//index.html") | ||
.get { content } | ||
.asHtml(true) | ||
.select("body") | ||
.matches() | ||
.innerHtml() | ||
.isEqualTo("<p>Bob->Alice : hello</p>") | ||
} | ||
|
||
@Test | ||
@DisplayName("Test that PlantUml syntax is not supported when the module is not included. Homepage file will not be found at all.") | ||
fun test02() { | ||
resource("homepage.uml", | ||
""" | ||
|Bob->Alice : hello | ||
""".trimMargin() | ||
) | ||
|
||
val testResults = execute() | ||
expectThat(testResults) | ||
.pageWasRendered("//index.html") | ||
.get { content } | ||
.asHtml(true) | ||
.select("body") | ||
.matches() | ||
.innerHtml() | ||
.isEqualTo("") | ||
} | ||
|
||
@Test | ||
@DisplayName("Test that Asciidoc syntax works when the file ends with .uml when the module is included") | ||
fun test03() { | ||
enableLogging() | ||
resource("homepage.uml", | ||
""" | ||
|Bob->Alice : hello | ||
""".trimMargin() | ||
) | ||
|
||
val testResults = execute(DiagramsModule()) | ||
testResults.printResults() | ||
expectThat(testResults) | ||
.pageWasRendered("//index.svg") | ||
.get { content } | ||
.asHtml(true) | ||
.select("body > svg") | ||
.matches() | ||
} | ||
|
||
} |