Join Slack
Powered by
Is there a way to pass a set of test environment v...
# clikt
a
adk
12/22/2020, 4:02 PM
Is there a way to pass a set of test environment variables to Clikt for testing? I'd like to test that my Clikt app does the right thing given a certain combo of env vars, options, etc.
a
AJ Alt
12/22/2020, 5:05 PM
I use system-rules (
https://stefanbirkner.github.io/system-rules/
) in my tests. Here's an example:
https://github.com/ajalt/clikt/blob/master/clikt/src/jvmTest/kotlin/com/github/ajalt/clikt/parameters/EnvvarOptionsTest.kt
AJ Alt
12/22/2020, 5:05 PM
It's JVM-only, though. If you need K/N, you'd have to call
setenv
manually in setup/teardown.
a
adk
12/22/2020, 5:38 PM
Thanks! 🙂
181
Views
Open in Slack
Previous
Next