给定如下代码:
class RESTAcceptanceTest extends Specification {
override def is = anonymous ^ signinOAuth
def anonymous = "Something" ^ givenSomething ^
"must happen" ^ mustHappen
end
def signinOAuth = "Signin" ^ givenSignin ^
"works as expected" ^ userExistsInDatabase
end
// rest of object definitions
}
如何确保在“匿名”和“signinOAuth”之前/之后执行相同的代码之前和之后,即使测试本身失败,“之后”方法也应该执行?