*/
public class ResultMatchers {
/**
* Matches if the tests are all successful
*/
public static Matcher isSuccessful() {
return failureCountIs(0);
}
/**
* Matches if there are {@code count} failures
*/
public static Matcher failureCountIs(final int count) {
return new TypeSafeMatcher() {
public void describeTo(Description description) {
description.appendText("has " + count + " failures");
}
@Override
public boolean matchesSafely(PrintableResult item) {
return item.failureCount() == count;
}
};
}
/**
* Matches if the result has exactly one failure, and it contains {@code string}
*/
public static Matcher