Skip to content

Commit

Permalink
Update mordant to 3.0 (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajalt authored Sep 13, 2024
1 parent 8626f4f commit b1f5b42
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions clikt-mordant/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ kotlin {
dependencies {
api(project(":clikt"))
api(libs.mordant)
api(libs.mordant.markdown)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ inline fun <T : BaseCliktCommand<T>> BaseCliktCommand<T>.test(
configureContext {
val originalReader = readEnvvar
readEnvvar = { envvars[it] ?: (if (includeSystemEnvvars) originalReader(it) else null) }
terminal = Terminal(terminal.theme, terminal.tabWidth, recorder)
terminal = Terminal(
theme = terminal.theme,
tabWidth = terminal.tabWidth,
terminalInterface = recorder
)
}
try {
parse(argv)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.github.ajalt.clikt.testing.TestCommand
import com.github.ajalt.clikt.testing.test
import com.github.ajalt.mordant.terminal.ConversionResult
import com.github.ajalt.mordant.terminal.YesNoPrompt
import com.github.ajalt.mordant.terminal.prompt
import io.kotest.matchers.shouldBe
import io.kotest.matchers.string.shouldContain
import kotlin.js.JsName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ class TestingUtilsTest {
fun `test TerminalInfo configuration`() {
class C : TestCommand() {
override fun run_() {
with(currentContext.terminal.info) {
ansiLevel shouldBe AnsiLevel.NONE
width shouldBe 11
height shouldBe 22
ansiHyperLinks shouldBe true
outputInteractive shouldBe true
inputInteractive shouldBe true
with(currentContext.terminal) {
terminalInfo.ansiLevel shouldBe AnsiLevel.NONE
size.width shouldBe 11
size.height shouldBe 22
terminalInfo.ansiHyperLinks shouldBe true
terminalInfo.outputInteractive shouldBe true
terminalInfo.inputInteractive shouldBe true
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[versions]
kotlin = "2.0.0"
coroutines = "1.8.1"
mordant = "3.0.0"

[libraries]
mordant = "com.github.ajalt.mordant:mordant:2.6.0"
mordant = {module = "com.github.ajalt.mordant:mordant", version.ref = "mordant"}
mordant-markdown = {module = "com.github.ajalt.mordant:mordant-markdown", version.ref = "mordant"}

# used in tests
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
Expand Down

0 comments on commit b1f5b42

Please sign in to comment.