summaryrefslogtreecommitdiff
path: root/crashboxd/src/test/scala/io/crashbox/ci/yaml/CompositeReadersSpec.scala
diff options
context:
space:
mode:
Diffstat (limited to 'crashboxd/src/test/scala/io/crashbox/ci/yaml/CompositeReadersSpec.scala')
-rw-r--r--crashboxd/src/test/scala/io/crashbox/ci/yaml/CompositeReadersSpec.scala26
1 files changed, 26 insertions, 0 deletions
diff --git a/crashboxd/src/test/scala/io/crashbox/ci/yaml/CompositeReadersSpec.scala b/crashboxd/src/test/scala/io/crashbox/ci/yaml/CompositeReadersSpec.scala
new file mode 100644
index 0000000..02a13ca
--- /dev/null
+++ b/crashboxd/src/test/scala/io/crashbox/ci/yaml/CompositeReadersSpec.scala
@@ -0,0 +1,26 @@
+package io.crashbox.ci
+package yaml
+
+import org.scalatest._
+
+class CompositeReadersSpec
+ extends FlatSpec
+ with Matchers
+ with CompositeReaders
+ with SimpleReaders {
+
+ "CompositeReaders" should "convert yaml" in {
+ assert(
+ Yaml.parse("hello: world").convertTo[Map[String, String]] == Map(
+ "hello" -> "world"))
+ assert(
+ Yaml.parse("hello: 42").convertTo[Map[String, Int]] == Map(
+ "hello" -> 42))
+
+ assert(Yaml.parse("- 42").convertTo[Seq[Int]] == Seq(42))
+ assert(
+ Yaml.parse("hello:\n - 42").convertTo[Map[String, Seq[Int]]] == Map(
+ "hello" -> Seq(42)))
+ }
+
+}