我有以下简单测试:
class ClasspathTest extends FlatSpec with Matchers {
"The classpath" should "have more than one member" in {
System.getProperty("java.class.path").split(":").length should be > 1
}
}
这位于SBT项目中。当从想法中运行此操作时,此测试成功了,因为它包含我在build.sbt
中指定的所有libraryDependencies
。
但是,在执行sbt test
时,它失败了,因为它仅包含/opt/sbt/bin/sbt-launch.jar
。
现在,我有一个测试,依赖对此Runtime class Path的填充。
是否可以以某种方式填充它?
这是Runtime
的Real SBT Class Path的重复要使它起作用,我必须在我的build.sbt中包括:
fork in Test := true