I'm using the Play Framework v2.04 with Scala on OS X (installed via Homebrew). Everything works as expected, however I can't seem to get the basic Hello World sample specs2 test from the Play website's documentation to run. This is the code within my /app/test/example.scala
file:
import org.specs2.mutable._
import play.api.test._
import play.api.test.Helpers._
class HelloWorldSpec extends Specification {
"The 'Hello world' string" should {
"contain 11 characters" in {
"Hello world" must have size(11)
}
"start with 'Hello'" in {
"Hello world" must startWith("Hello")
}
"end with 'world'" in {
"Hello world" must endWith("world")
}
}
}
However when I run play test
, I get the following error:
[error] /app/test/example.scala:3: object test is not a member of package play.api
AFAIK, the test object should be a member of the play.api package (according to the API reference documentation).
Any ideas on how to resolve this?
Thanks!
Create test
directory under the project root directory and move the example.scala
from app/test
to test
.