Skip to content

Instantly share code, notes, and snippets.

@stellingsimon
Created February 21, 2018 17:48
Show Gist options
  • Save stellingsimon/1bd329a87902c7ff304629a1cc4e312c to your computer and use it in GitHub Desktop.
Save stellingsimon/1bd329a87902c7ff304629a1cc4e312c to your computer and use it in GitHub Desktop.
Skipping Tests are Failing Tests
// Usage in Test Class:
// @Rule
// public SkippingRule skippingTests = failingTests();
public class SkippingRule extends TestWatcher {
@Override
protected void skipped(AssumptionViolatedException e, Description description) {
Assert.fail("Test has assumptions that are violated. Please fix them.");
}
private SkippingRule() {
// use failingTests() factory method
}
public static SkippingRule failingTests() {
return new SkippingRule();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment