Search code examples
scalaunit-testingplayframework-2.0specs2

Scala test cannot find any test to run


I am trying to run some test in scala play framework. Here is the code that I have written

package com.sentrana.mmcore.integrationTests

import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._
import play.api.test._
import play.api.test.Helpers._
import play.api.libs.json._

class ApplicationSpec extends Specification with Tags {
  "Application" should {
    "work" in new WithApplication {
      route(FakeRequest(GET, "/boum")) must beNone
    }
  }

}

This is the command that I am using to run the test -

test-only com.sentrana.mmcore.integrationTests.ApplicationSpec

I am not getting any error. But it is showing me that 0 tests have been.


Solution

  • If you add you test using IntellijIDEA make sure that the file has .scala extension. The IDE does not show errors but the activator cannot find the test because it is searching for scala files.