Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala 从“运行测试时”;sbt测试“;类路径与从IDEA运行时不同_Scala_Sbt_Classpath_Scalatest - Fatal编程技术网

Scala 从“运行测试时”;sbt测试“;类路径与从IDEA运行时不同

Scala 从“运行测试时”;sbt测试“;类路径与从IDEA运行时不同,scala,sbt,classpath,scalatest,Scala,Sbt,Classpath,Scalatest,我有以下简单的测试: 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项目中。从IDEA运行此测试时,此测试成功,因为它包含我在build

我有以下简单的测试:

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项目中。从IDEA运行此测试时,此测试成功,因为它包含我在
build.sbt
中指定的所有
libraryDependencies

但是,当执行
sbt测试时
失败,因为它只包含
/opt/sbt/bin/sbt launch.jar

现在我有一个测试,它依赖于这个运行时类路径是否被完全填充

是否可以以某种方式填充它?

这是的副本

要使其正常工作,我必须在build.sbt中包括:

fork in Test := true