import org.specs2.mutable.SpecWithJUnit
import org.specs2.specification.Scope
import org.specs2.execute.Failure
class MyTest extends SpecWithJUnit {
trait Context extends Scope
"myClass" should {
"work but not right now" in new Context {
Failure("test fails")
}
}
}
在这个 Specs2 示例中,我如何将测试标记为待定直到修复(就像我对 SpecificationWithJUnit 所做的那样)?
最佳答案
您需要添加 PendingUntilFixed
特性:
import org.specs2.mutable.SpecWithJUnit
import org.specs2.specification.Scope
import org.specs2.execute.{PendingUntilFixed, Failure}
class TestSpec extends SpecWithJUnit with PendingUntilFixed {
trait Context extends Scope
"myClass" should {
"work but not right now" in new Context {
failure("test fails")
}.pendingUntilFixed("for now")
}
}
关于scala - 如何使用 SpecWithJUnit 将测试标记为 pendingUntilFixed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31671810/