summaryrefslogtreecommitdiff
path: root/crashboxd/src/test/scala/io/crashbox/ci/ParserSpec.scala
blob: 8834af92a2548c832c1219bb20fc0491fc84e980 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package io.crashbox.ci

import org.scalatest._

class ParserSpec extends FlatSpec with Matchers {

  val build = """|tasks:
                 | main:
                 |  image: foo/bar
                 |  script: echo "hello world"
                 |""".stripMargin

  val parsed = BuildDef(
    Seq(TaskDef(DockerEnvironment("foo/bar"), "echo \"hello world\"")))

  "Parser" should "parse build definitions" in {
    assert(Parser.parse(build) == Parser.Success(parsed))
  }
}