Im working on a playframework project in scala. Our team however wants to use scalatest instead of specs. I've added the following to the plugins.sbt file:
libraryDependencies += "org.scalatest" %% "scalatest" % "1.7.1" "test"
But when I start play, no new jars are being downloaded, not even after running
update
and when i run
library-dependencies
it shows me this
[info] List(org.scala-lang:scala-library:2.9.1, play:play:2.0, play:play-test:2.0:test)
Also when I try to test I get a compile error saying that org.scalatest is not in the buildpath. Does anyone know what is going wrong?
You should modify project/Build.scala, and better to use like the following:-
val appDependencies = Seq(
// Add your project dependencies here,
"org.scalatest" %% "scalatest" % "1.7.2" % "test"
)
Please use the version 1.7.2, which contains a bug fix in SBT integration.
Also, you'll need to set the testOptions to Nil:-
val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
// Add your own project settings here
testOptions in Test := Nil
)
This is because Play 2.0 by default will send the following Specs 2 test options in, which are:-
sequential true junitxml console
They are not recognized by ScalaTest, so setting testOptions to Nil should fix it.
You should modify project/Build.scala, make the following change
val appDependencies = Seq(
// Add your project dependencies here,
"org.scalatest" % "scalatest_2.9.1" % "1.7.1"
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With