rlegendi
rlegendi

Reputation: 10606

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!

Upvotes: 28

Views: 9725

Answers (1)

Don Roby
Don Roby

Reputation: 41127

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.

Upvotes: 44

Related Questions