how can I remove codes creating session in unit test for Play framework and slick
问题 I'm using play 2.0 and slick. so I write unit test for models like this. describe("add") { it("questions be save") { Database.forURL("jdbc:h2:mem:test1", driver = "org.h2.Driver") withSession { // given Questions.ddl.create Questions.add(questionFixture) // when val q = Questions.findById(1) // then // assert!!! } } } it works well but following snippets is dupulicated every unit test. Database.forURL("jdbc:h2:mem:test1", driver = "org.h2.Driver") withSession { Questions.ddl.create // test