ラッパー関数で spec2 仕様のすべてのテストを実行するにはどうすればよいですか?
元:
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 つのテストはそれぞれ、
with(someSession){...
ScalaTest を使用する場合、 withFixtureをオーバーライドして実行できます。