From 26aa8adc30a84d983d020e34b488ac22a31cb544 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Sat, 1 Apr 2017 13:21:15 -0700 Subject: Add yaml parser and docker executor --- .../test/scala/io/crashbox/ci/yaml/YamlSpec.scala | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 crashboxd/src/test/scala/io/crashbox/ci/yaml/YamlSpec.scala (limited to 'crashboxd/src/test/scala/io/crashbox/ci/yaml/YamlSpec.scala') diff --git a/crashboxd/src/test/scala/io/crashbox/ci/yaml/YamlSpec.scala b/crashboxd/src/test/scala/io/crashbox/ci/yaml/YamlSpec.scala new file mode 100644 index 0000000..6d1de66 --- /dev/null +++ b/crashboxd/src/test/scala/io/crashbox/ci/yaml/YamlSpec.scala @@ -0,0 +1,40 @@ +package io.crashbox.ci +package yaml + +import org.scalatest._ + +class YamlSpec extends FlatSpec with Matchers { + + val yml = """|--- + |foo: bar + |buz: qux + |list: + | - elem1 + | - elem2 + |map: + | elem1: foo + | elem2: bar + | elem3: + |""".stripMargin + + val tree = YamlMap( + Map( + "foo" -> YamlString("bar"), + "buz" -> YamlString("qux"), + "list" -> YamlSeq( + Seq( + YamlString("elem1"), + YamlString("elem2") + )), + "map" -> YamlMap( + Map( + "elem1" -> YamlString("foo"), + "elem2" -> YamlString("bar"), + "elem3" -> YamlString("") + )) + )) + + "Yaml" should "parse valid yaml" in { + assert(Yaml.parse(yml) == tree) + } +} -- cgit v1.2.3