scala - Specify the configuration to be used in Specs2 tests with Play 2.4 -


i trying run specs2 tests in play 2.4 scala. because application depends on guice di modules, need have configurations available these modules require, if tests not directly depend on these modules.

i have conf/dev.conf file contains necessary configurations. file includes default conf/application.conf.

how can make specs2 tests use alternative conf/dev.conf when running tests in play 2.4?

i've looked around stackoverflow , seems other advice available, apply play 2.3 or older. help? thanks!

try putting in build.sbt:

fork in test := true  javaoptions in test += "-dconfig.resource=dev.conf" 

this enable forking tests allows specify custom parameters jvm different environments.

see specifying alternative configuration file , sbt's various forking options.


Comments