Skip to content

Commit

Permalink
colon in messages
Browse files Browse the repository at this point in the history
  • Loading branch information
panchenko committed Feb 16, 2018
1 parent f8610d1 commit 8d16892
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/junit/Assert.java
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,6 @@ public static <T extends Throwable> T assertThrows(String message, Class<T> expe
}

private static String buildPrefix(String message) {
return message != null && message.length() != 0 ? message + " ==> " : "";
return message != null && message.length() != 0 ? message + ": " : "";
}
}
4 changes: 2 additions & 2 deletions src/test/java/org/junit/tests/assertion/AssertionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ public void assertThrowsIncludesTheSpecifiedMessage() {
assertThrows("Foobar", Throwable.class, nonThrowingRunnable());
} catch (AssertionError ex) {
assertEquals(
"Foobar ==> expected java.lang.Throwable to be thrown, but nothing was thrown",
"Foobar: expected java.lang.Throwable to be thrown, but nothing was thrown",
ex.getMessage());
return;
}
Expand Down Expand Up @@ -928,7 +928,7 @@ public void assertThrowsSuppliesTheSpecifiedMessageUponTypeMismatch() {
try {
assertThrows("Foobar", IOException.class, throwingRunnable(npe));
} catch (AssertionError error) {
assertEquals("Foobar ==> unexpected exception type thrown; expected:<java.io.IOException> but was:<java.lang.NullPointerException>",
assertEquals("Foobar: unexpected exception type thrown; expected:<java.io.IOException> but was:<java.lang.NullPointerException>",
error.getMessage());
assertSame(npe, error.getCause());
return;
Expand Down

0 comments on commit 8d16892

Please sign in to comment.