如何指示sbt 0.11.x哪些源文件包含测试

Bum*_*Gee 1 specs scala sbt

我是Scala,SBT和Specs的新手.我已经使用规范创建了一个简单的规范,并喜欢通过"测试"任务通过SBT运行它.当我执行该任务时,我收到以下错误:

> test
[info] No tests to run for test:test
[success] Total time: 0 s, completed Nov 30, 2011 4:27:38 PM
Run Code Online (Sandbox Code Playgroud)

我知道我必须告诉SBT我的哪些文件是测试文件.我在SBT主页和Stackoverflow上找到的唯一例子就是这段代码

override def includeTest(s: String) = { s.endsWith("Spec") }
Run Code Online (Sandbox Code Playgroud)

我包含在Build.scala文件中.但是,似乎这不再适用于SBT 0.11.x. 我收到以下编译错误

[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") }
Run Code Online (Sandbox Code Playgroud)

有人知道如何使用新的SBT版本吗?

在此先感谢您的帮助!

干杯,格奥尔格

ste*_*tew 6

将.scala文件放在$ project/src/test/scala而不是$ project/src/main/scala中进行测试