fix: check if patch option requirement is met

This commit is contained in:
Sculas
2022-08-02 22:41:34 +02:00
parent 35c6489dba
commit 14a73bfcaf
2 changed files with 13 additions and 2 deletions

View File

@@ -39,10 +39,10 @@ internal class PatchOptionsTest {
@Test
fun `should be able to set value to null`() {
// Sadly, doing:
// > options["key1"] = null
// > options["key2"] = null
// is not possible because Kotlin
// cannot reify the type "Nothing?".
options.nullify("key1")
options.nullify("key2")
}
@Test
@@ -65,4 +65,11 @@ internal class PatchOptionsTest {
options["key3"] = "this value is not an allowed option"
}
}
@Test
fun `should fail because of the requirement is not met`() {
assertThrows<RequirementNotMetException> {
options.nullify("key1")
}
}
}