I am using specs2 as my test framework. I want to generate a uniq key that will be available in the test itself.
def around[R: AsResult](r: => R): Result = {
val uniqueToken = before()
try AsResult(r)(uniqueToken)
finally after(uniqueToken)
}
"foo" should {
"bar" in {
do something with uniqueToken
}
}
Couldn't find any good way to do it.. Any idea?
Aucun commentaire:
Enregistrer un commentaire