using scalatest in a playframework project

playframework, sbt, scalatest

Solution

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.

Problem

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?

Original source