28

我需要将我的一个测试用例置于“待定”状态。

我想给它添加一些消息,在运行测试时可以在输出中显示,比如带有@Ignore("Pending: issue #1234 needs to be fixed").

Specs2 有对应的吗?

class MySpec extends mutable.Specification {
  args(skipAll = true) // Can I include a message here in the output somehow?

  "cool MyClass feature" should {
    "which is broken unfortunately" in {
      failure
    }
  }
}

提前致谢!

4

1 回答 1

43

对于一个单独的例子,我相信你可以使用:

class MySpec extends mutable.Specification {

  "cool MyClass feature" should {
    "which is broken unfortunately" in {
      failure
    }.pendingUntilFixed("message about the issue")
  }

}

我不知道是否有一种方法可以扩展它以将规范中的所有示例标记为带有相同消息的待处理,正如您似乎希望的那样。

于 2012-06-08T11:09:17.117 回答