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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

mysql - Pass value between different pages (form) with PHP -