All checks were successful
/ Build and Test Library Snapshot (pull_request) Successful in 2m5s
27 lines
727 B
Scala
27 lines
727 B
Scala
package gs.config.v0
|
|
|
|
import cats.syntax.all.*
|
|
|
|
class ConfigNameTests extends munit.FunSuite:
|
|
|
|
test("should express some name as an environment variable") {
|
|
val raw = "some.config-key"
|
|
val expected = "SOME_CONFIG_KEY"
|
|
val name = ConfigName(raw)
|
|
assertEquals(name.toEnvironmentVariable(), expected)
|
|
}
|
|
|
|
test("should unwrap some name as a string") {
|
|
val raw = "some.config-key"
|
|
val expected = raw
|
|
val name = ConfigName(raw)
|
|
assertEquals(name.unwrap(), expected)
|
|
assertEquals(name.show, expected)
|
|
}
|
|
|
|
test("should support equality") {
|
|
val raw = "some.config-key"
|
|
val name1 = ConfigName(raw)
|
|
val name2 = ConfigName(raw)
|
|
assertEquals(name1, name2)
|
|
}
|