Error when running Scalatra test on Intellij

1

I'm trying to run the following test from the within the < a

class Test extends ScalatraFlatSpec with Matchers {
  addServlet(classOf[MainServlet], "/*")

  "Home Page" should "show hello" in {
    get("/"){
      status should equal (200);
    }
  }
}

And IDE is returning me the following error:

java.lang.Exception: No runnable methods
  at org.junit.internal.runners.MethodValidator.validateInstanceMethods(MethodValidator.java:32)
  at org.junit.internal.runners.MethodValidator.validateMethodsForDefaultRunner(MethodValidator.java:43)
  at org.junit.internal.runners.JUnit4ClassRunner.validate(JUnit4ClassRunner.java:36)
  at org.junit.internal.runners.JUnit4ClassRunner.<init>(JUnit4ClassRunner.java:27)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
  at org.junit.internal.requests.ClassRequest.buildRunner(ClassRequest.java:33)
  at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
  at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
    
asked by anonymous 14.03.2015 / 19:15

1 answer

2

I got this same error when I was running the and not as a test of the .

Not always the hits the correct type of test.

If this is the case to fix change from:

To:

And the test will run correctly:

    
14.03.2015 / 19:15