Specs2: skip inherited test suite

113 views Asked by At

In specs2, given the following code:

import org.specs2.mutable.SpecificationWithJUnit

trait TestSuite extends SpecificationWithJUnit {
...
}

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

How in concrete test implementation of a test suite, to skip the whole suite?

1

There are 1 answers

1
Genry On BEST ANSWER

Found it:

import org.specs2.mutable.SpecificationWithJUnit

trait TestSuite extends SpecificationWithJUnit {
...
}

class ConcreteTest extends TestSuite {
  skipAll
}

Reference: ArgumentsShortcuts

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

This trait is transitively inherited to SpecificationWithJunit via the path: SpecificationWithJunit -> Specification -> SpecificationLike -> SpecificationCreation -> ArgumentsShortcuts