scala - Play2: How to do execute piece of code before each test using specs2 -
i have code:
class accountspec extends specification { def fakeapp = fakeapplication(additionalconfiguration = inmemorydatabase()) "every account" should { "have user" in running(fakeapp) { account.create("basic account", "username") ... etc... } } } if try run spec error, because there no user username "username". is:
def before = { createtestuser() } i have tried different approaches havent found solution yet.
just extend trait org.specs2.mutable.beforeafter, comes before , after methods, implement them, here link documentation docs
Comments
Post a Comment