Hello World Spec Test

src/test/scala 目錄中的一個名為 HelloWorldSpec.scala 的檔案中建立一個測試類。把它放在檔案中:

import org.scalatest.{FlatSpec, Matchers}

class HelloWorldSpec extends FlatSpec with Matchers {

  "Hello World" should "not be an empty String" in {
      val helloWorld = "Hello World"
      helloWorld should not be ("")
  }
}