I have a strange problem in IntelliJ IDEA: I have an SBT project which has ScalaTests. I organized my settings in blocks like this:
lazy val common = Seq(
organization := "com.example.foo",
version := "0.0.1-SNAPSHOT",
scalaVersion := "2.10.5",
fork in Test := true,
testListeners += new JUnitXmlTestsListener(
new File(target.value, "test-reports").getAbsolutePath
)
)
lazy val testWithScalatest = Seq(
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.4" % "test"
)
lazy val bar = project.in(file("some/where/foo/bar")).settings(common).settings(testWithScalatest).settings(name:="bar")
When I run sbt test
, the tests run fine without any errors. However, when I right-click the test class in the project explorer of IDEA, the "Run tests" option is not there. I can right-click the package the test class is in and select "Run ScalaTests in...", but then I get something like this:
Error running ScalaTests in 'bar': Cannot start process, the working directory C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 14.1.4\jre\jre\bin does not exist
When I try to edit the run configuration, the settings panel in the "Run/Debug Configurations" window is empty.
I cannot add a new configuration either.
What is the problem here?
EDIT: I have the same problem when using Specs2.