Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specs2: Ignore specification with a message?

I need to put one of my test cases into a "pending" state.

I would like to assing some sort of message to it that can be displayed on the output when running the test, something like JUnit with @Ignore("Pending: issue #1234 needs to be fixed").

Is there an equivalent for that with 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
    }
  }
}

Thanks in advance!

like image 413
rlegendi Avatar asked Jun 08 '12 10:06

rlegendi


1 Answers

For an individual example, I believe you can use:

class MySpec extends mutable.Specification {

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

}

I don't know if there's a way to extend this to mark all the examples in a spec as pending with the same message, as you seem to be hoping.

like image 103
Don Roby Avatar answered Oct 22 '22 18:10

Don Roby