Created
February 21, 2018 17:48
-
-
Save stellingsimon/1bd329a87902c7ff304629a1cc4e312c to your computer and use it in GitHub Desktop.
Skipping Tests are Failing Tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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