1

I'm new to Scala, SBT and Specs. I have created a simple specification using specs and like to run it via SBT with the "test" task. When I execute that task, I get the following error:

> test
[info] No tests to run for test:test
[success] Total time: 0 s, completed Nov 30, 2011 4:27:38 PM

I understand that I have to tell SBT which of my files are test files. The only example I have found on the SBT homepage and on Stackoverflow is this piece of code

override def includeTest(s: String) = { s.endsWith("Spec") }

which I included in my Build.scala file. It seems, however, that this does no longer work with SBT 0.11.x. I get the following compilation error

[info] Compiling 1 Scala source to /Users/gruetter/Workspaces/scala/helloscala/project/target/scala-2.9.1/sbt-0.11.1/classes...
[error] /Users/gruetter/Workspaces/scala/helloscala/project/Build.scala:4: method includeTest overrides nothing
[error]     override def includeTest(s: String) = { s.endsWith("Spec") }

Does anybody know how this is done with the new SBT version?

Thanks in advance for your help!

Cheers, Georg

BumbleGee
  • 2,031
  • 3
  • 18
  • 18

1 Answers1

6

Put the .scala files for tests in $project/src/test/scala instead of $project/src/main/scala

stew
  • 11,276
  • 36
  • 49