4
如何在包裝函數中執行spec2規範的所有測試?執行包裝在函數中的specs2示例
例如:
class HelloWorldSpec extends Specification {
wrapAll(example) = {
// wrap it in a session, for example.
with(someSession){
example()
}
}
"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")
}
}
}
所以,每個3個測試應在
與(someSession){...裏面執行
當使用ScalaTest,我可以做,覆蓋與固定