Skip to content

Commit

Permalink
Improve expressiveness of test name
Browse files Browse the repository at this point in the history
The test name "beforesAndAftersAreEnclosedByRule" reflects the purpose
of the test better than "methodBeforesAndAfters".
  • Loading branch information
stefanbirkner committed Feb 8, 2018
1 parent 41c8f3e commit 43cdf99
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/test/java/org/junit/rules/TestRuleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ public void methodSucceeded() {
assertThat(WatchmanTest.watchedLog, containsString(String.format("succeeds(%s) success!", WatchmanTest.class.getName())));
}

public static class MethodBeforesAndAfters {
public static class BeforesAndAftersAreEnclosedByRule {
private static String watchedLog;

@Before
Expand Down Expand Up @@ -574,10 +574,10 @@ public void succeeds() {
}

@Test
public void methodBeforesAndAfters() {
MethodBeforesAndAfters.watchedLog = "";
JUnitCore.runClasses(MethodBeforesAndAfters.class);
assertThat(MethodBeforesAndAfters.watchedLog, is("starting before test after succeeded finished "));
public void beforesAndAftersAreEnclosedByRule() {
BeforesAndAftersAreEnclosedByRule.watchedLog = "";
JUnitCore.runClasses(BeforesAndAftersAreEnclosedByRule.class);
assertThat(BeforesAndAftersAreEnclosedByRule.watchedLog, is("starting before test after succeeded finished "));
}

public static class MethodWrongTypedField {
Expand Down

0 comments on commit 43cdf99

Please sign in to comment.