specs2Scala 軟件測試庫
Specs2是一個用于編寫可執(zhí)行軟件說明的Scala庫。可以用它來編寫可知性測試和性能測試。
示例代碼:
import org.specs2.mutable._
class HelloWorldSpec extends Specification {
"The 'Hello world' string" should {
"contain 11 characters" in {
"Hello world" must have size(11)
}
"start with 'Hello'" in {
"Hello world" must startWith("Hello")
}
"end with 'world'" in {
"Hello world" must endWith("world")
}
}
}
評論
圖片
表情
