如何设置自定义配置文件进行测试?

时间:2015-02-25 11:42:49

标签: scala playframework-2.3

测试(使用activator test执行)使用conf/application.conf。我想设置一个自定义配置文件,仅用于测试。怎么样?

How do I specify a config file with sbt 0.12.2 for sbt test?中有一个解决方案,但它使用的Build.scala在游戏2.3中不可用。我试图将javaOptions in Test += "-Dconfig.file=conf/local.conf"放入build.sbt,但它不起作用。

1 个答案:

答案 0 :(得分:2)

解决方案确实是在javaOptions in Test += "-Dconfig.file=conf/local.conf"中使用build.sbt

我在发布问题时没有用,因为我在fork in Test := false中使用build.sbt禁用了分叉,因此javaOptions in Test对测试运行设置没有影响。

相关问题