【问题标题】:Specs2: skip inherited test suiteSpecs2:跳过继承的测试套件
【发布时间】:2021-04-29 12:29:08
【问题描述】:

在 specs2 中,给出以下代码:

import org.specs2.mutable.SpecificationWithJUnit

trait TestSuite extends SpecificationWithJUnit {
...
}

class ConcreteTest extends TestSuite {
  // want to skip the whole test suite here
}

如何在测试套件的具体测试实现中跳过整个套件?

【问题讨论】:

    标签: scala specs2


    【解决方案1】:

    找到了:

    import org.specs2.mutable.SpecificationWithJUnit
    
    trait TestSuite extends SpecificationWithJUnit {
    ...
    }
    
    class ConcreteTest extends TestSuite {
      skipAll
    }
    

    参考:ArgumentsShortcuts

      /**
       * shortcut to skip all examples
       */
      def skipAll: Arguments = args(skipAll = ArgProperty(true))
    

    此特征通过以下路径传递给SpecificationWithJunitSpecificationWithJunit -> Specification -> SpecificationLike -> SpecificationCreation -> ArgumentsShortcuts

    【讨论】:

    • 当然,会详细说明
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-02-11
    • 2017-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多