@Test public void test_mismatch_description_is() { final Matcher<Throwable> hasValidMessage = message(is("no value")); final Throwable t = new RuntimeException("No value!"); assertThat("Matching fails", hasValidMessage.matches(t), is(false)); StringDescription desc = new StringDescription(); hasValidMessage.describeMismatch(t, desc); assertThat(desc.toString(), is("message was \"No value!\"")); }
@Factory public static ExceptionMessage message(Matcher<? super String> messageMatcher) { return new ExceptionMessage(messageMatcher); }
ExceptionMessage extends TypesafeNestedResultMatcher<Throwable> { @Factory public static ExceptionMessage message(Matcher<? super String> messageMatcher) { return new ExceptionMessage(messageMatcher); } }
ExceptionMessage extends TypesafeNestedResultMatcher<Throwable> { @Factory public static ExceptionMessage message(Matcher<? super String> messageMatcher) { return new ExceptionMessage(messageMatcher); } ExceptionMessage(Matcher<? super String> messageMatcher); }
ExceptionMessage extends TypesafeNestedResultMatcher<Throwable> { @Factory public static ExceptionMessage message(Matcher<? super String> messageMatcher) { return new ExceptionMessage(messageMatcher); } ExceptionMessage(Matcher<? super String> messageMatcher); @Override int getDescriptionPrecedence(); @Override void describeTo(Description description); @Factory static ExceptionMessage messageIs(String message); @Factory static ExceptionMessage messageContains(String regex); @Factory static ExceptionMessage messageMatches(String regex); @Factory static ExceptionMessage messageContains(Pattern pattern); @Factory static ExceptionMessage messageMatches(Pattern pattern); @Factory static ExceptionMessage message(Matcher<? super String> messageMatcher); }
ExceptionMessage extends TypesafeNestedResultMatcher<Throwable> { @Factory public static ExceptionMessage message(Matcher<? super String> messageMatcher) { return new ExceptionMessage(messageMatcher); } ExceptionMessage(Matcher<? super String> messageMatcher); @Override int getDescriptionPrecedence(); @Override void describeTo(Description description); @Factory static ExceptionMessage messageIs(String message); @Factory static ExceptionMessage messageContains(String regex); @Factory static ExceptionMessage messageMatches(String regex); @Factory static ExceptionMessage messageContains(Pattern pattern); @Factory static ExceptionMessage messageMatches(Pattern pattern); @Factory static ExceptionMessage message(Matcher<? super String> messageMatcher);  }