I have installed Eclipse Luna. Then I installed Scala IDE via Help
-> Install new software
and adding software site with link from here. Then I installed sbt 0.13 and sbteclipse using this mini-guide and created eclipse project. Then I installed (kindda) scalatest by adding it to my build.sbt. Now it looks like this:
val scalaTest = "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test"
lazy val commonSettings = Seq(
scalaVersion := "2.11.6"
)
lazy val root = (project in file(".")).
settings(commonSettings: _*).
settings(
libraryDependencies += scalaTest
)
Then I created a test from this example. The file called FirstSpec.scala
is located in testProject/src/test/scala-2.11/testProject/
. So here is a problem: eclipse seems to not see scalaTest. The second line with import org.scalatest._
is underlined red with error description object scalatest is not a member of package org
. And, following this guide, I don't see the option Run As -> ScalaTest - Suite
when choosing my test class.
At the same time everything goes good and fine when I start sbt session in my test project and type test
command. The tests launches and passes.
So my questions are:
- why eclipse doesn't see the scalatest if I put it in
build.sbt
'slibraryDependencies
? What's the point of libraryDependencies then? - Why
sbt test
runs the tests without a problem? If sbt sees scalatest, why eclipse can't?