How do you check if you program is being tested from inside the application with specs2? For example in Play you can check with play.Play.isTest()
Use a proper DI technique such as Cake (or even in simpler cases constructor parameter injection) and you have control over things that need to be done differently or take variant forms during testing.