-
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.
Merge pull request #223 from JavaEden/dev
Release 0.15.3
- Loading branch information
Showing
25 changed files
with
373 additions
and
99 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,7 @@ | ||
--- | ||
version: '0.15.3' | ||
--- | ||
|
||
- Updates OrchidBible dependency to hit correct endpoints and improves usability | ||
- Parses external URLs better | ||
- Passes command line args directly through to Dokka so Gradle can supply the proper documentation classpath |
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
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
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
80 changes: 80 additions & 0 deletions
80
OrchidCore/src/test/kotlin/com/eden/orchid/api/theme/pages/OrchidReferenceTest.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,80 @@ | ||
package com.eden.orchid.api.theme.pages | ||
|
||
import com.caseyjbrooks.clog.Clog | ||
import com.eden.orchid.api.OrchidContext | ||
import org.junit.jupiter.api.BeforeEach | ||
import org.junit.jupiter.params.ParameterizedTest | ||
import org.junit.jupiter.params.provider.CsvSource | ||
import org.mockito.Mockito.mock | ||
import strikt.api.expectThat | ||
import strikt.api.expectThrows | ||
import strikt.assertions.isEqualTo | ||
|
||
class OrchidReferenceTest { | ||
|
||
lateinit var context: OrchidContext | ||
|
||
@BeforeEach | ||
internal fun setUp() { | ||
context = mock(OrchidContext::class.java) | ||
} | ||
|
||
@ParameterizedTest | ||
@CsvSource( | ||
"/one/two/three/four/five, 0, one", | ||
"/one/two/three/four/five, 1, two", | ||
"/one/two/three/four/five, 2, three", | ||
"/one/two/three/four/five, 3, four", | ||
"/one/two/three/four/five, 4, five", | ||
|
||
"/one/two/three/four/five, -5, one", | ||
"/one/two/three/four/five, -4, two", | ||
"/one/two/three/four/five, -3, three", | ||
"/one/two/three/four/five, -2, four", | ||
"/one/two/three/four/five, -1, five" | ||
) | ||
fun testGetPathSegment(path: String, index: Int, segment: String) { | ||
val ref = OrchidReference(context, path) | ||
|
||
expectThat(ref.getPathSegment(index)).isEqualTo(segment) | ||
} | ||
|
||
@ParameterizedTest | ||
@CsvSource( | ||
"/one/two/three/four/five, 5", | ||
"/one/two/three/four/five, -6" | ||
) | ||
fun testGetPathSegmentThrowing(path: String, index: Int) { | ||
val ref = OrchidReference(context, path) | ||
|
||
expectThrows<ArrayIndexOutOfBoundsException> { ref.getPathSegment(index) } | ||
} | ||
|
||
@ParameterizedTest | ||
@CsvSource( | ||
// basic examples | ||
"http://www.example.com/example , , ", | ||
"https://www.example.com/example , , ", | ||
"https://www.example.com/example#one , one, ", | ||
"https://www.example.com/example?one=two , , one=two ", | ||
"https://www.example.com/example?one=two&three=four, , one=two&three=four", | ||
|
||
// more complex examples | ||
"http://www.example.com/example.js , , ", | ||
"http://www.example.com/example/index , , ", | ||
"http://www.example.com/example/index.js , , ", | ||
"http://www.example.com/example/index.html , , " | ||
) | ||
fun testParsingExternalUrls(original: String, id: String?, query: String?) { | ||
val ref = OrchidReference.fromUrl(context, "", original) | ||
|
||
Clog.getInstance().setMinPriority(Clog.Priority.VERBOSE) | ||
|
||
expectThat(ref) { | ||
get { this.toString() }.isEqualTo(original) | ||
get { this.id }.isEqualTo(id) | ||
get { this.query }.isEqualTo(query) | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.