Skip to content

Commit

Permalink
Add ConfigEntrySpec#toStringWithResult tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Lövgren committed Nov 15, 2018
1 parent cecb35a commit 77bc68f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/shared/src/test/scala/ciris/ConfigEntrySpec.scala
Expand Up @@ -41,6 +41,20 @@ final class ConfigEntrySpec extends PropertySpec {
}
}

"using toStringWithResult" should {
"include the key, keyType, and result" in {
forAll { value: String =>
existingEntry(value).toStringWithResult shouldBe
s"ConfigEntry(key, ConfigKeyType(test key), Right($value))"
}
}

"include the key, keyType, and errors" in {
nonExistingEntry.toStringWithResult shouldBe
s"ConfigEntry(key, ConfigKeyType(test key), Left(ConfigErrors(MissingKey(key, ConfigKeyType(test key)))))"
}
}

"using withValue" should {
"replace the existing value" in {
existingEntry("value").withValue(Right("value2")).value shouldBe Right("value2")
Expand Down

0 comments on commit 77bc68f

Please sign in to comment.