~wegtam/smederee

Showing details for patch 48180ff13ef455d87f792b2aab2e1a222e3f616d.
2024-10-24 (Thu), 8:53 AM - Jens Grassel - 48180ff13ef455d87f792b2aab2e1a222e3f616d

Add test for ConfigurationPath

Summary of changes
1 files added
  • modules/hub/src/test/scala/de/smederee/hub/config/ConfigurationPathTest.scala
diff -rN -u old-smederee/modules/hub/src/test/scala/de/smederee/hub/config/ConfigurationPathTest.scala new-smederee/modules/hub/src/test/scala/de/smederee/hub/config/ConfigurationPathTest.scala
--- old-smederee/modules/hub/src/test/scala/de/smederee/hub/config/ConfigurationPathTest.scala	1970-01-01 00:00:00.000000000 +0000
+++ new-smederee/modules/hub/src/test/scala/de/smederee/hub/config/ConfigurationPathTest.scala	2024-11-21 22:50:48.726344141 +0000
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2022 Contributors as noted in the AUTHORS.md file
+ *
+ * Licensed under the EUPL
+ */
+
+package de.smederee.hub.config
+
+import munit.*
+
+import org.scalacheck.Prop.*
+
+final class ConfigurationPathTest extends ScalaCheckSuite {
+    property("from must only allow non-empty strings and trim them") {
+        forAll { (path: String) =>
+            val expected = Option(path).map(_.trim).filter(_.nonEmpty)
+            assertEquals(ConfigurationPath.from(path).map(_.toString), expected)
+        }
+    }
+}