Skip to content

Commit db2959c

Browse files
author
smgfreeman
committed
restructured test to show descriptions
1 parent d4d0877 commit db2959c

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed
Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
1-
/* Copyright (c) 2000-2006 hamcrest.org
1+
/* Copyright (c) 2000-2009 hamcrest.org
22
*/
33
package org.hamcrest.core;
44

5+
import static org.hamcrest.Matchers.greaterThan;
56
import static org.hamcrest.core.IsEqual.equalTo;
67
import static org.hamcrest.core.IsNot.not;
78

89
import org.hamcrest.AbstractMatcherTest;
910
import org.hamcrest.Matcher;
1011

1112
public class IsNotTest extends AbstractMatcherTest {
12-
@Override
13-
protected Matcher<?> createMatcher() {
14-
return not("something");
15-
}
13+
@Override
14+
protected Matcher<?> createMatcher() {
15+
return not("something");
16+
}
1617

17-
public void testEvaluatesToTheTheLogicalNegationOfAnotherMatcher() {
18-
assertMatches("should match", not(equalTo("A")), "B");
19-
assertDoesNotMatch("should not match", not(equalTo("B")), "B");
20-
}
18+
public void testEvaluatesToTheTheLogicalNegationOfAnotherMatcher() {
19+
assertMatches("should match", not(equalTo("A")), "B");
20+
assertDoesNotMatch("should not match", not(equalTo("B")), "B");
21+
}
2122

22-
public void testProvidesConvenientShortcutForNotEqualTo() {
23-
assertMatches("should match", not("A"), "B");
24-
assertMatches("should match", not("B"), "A");
25-
assertDoesNotMatch("should not match", not("A"), "A");
26-
assertDoesNotMatch("should not match", not("B"), "B");
27-
assertDescription("not \"A\"", not("A"));
28-
}
29-
}
23+
public void testProvidesConvenientShortcutForNotEqualTo() {
24+
assertMatches("should match", not("A"), "B");
25+
assertMatches("should match", not("B"), "A");
26+
assertDoesNotMatch("should not match", not("A"), "A");
27+
assertDoesNotMatch("should not match", not("B"), "B");
28+
}
29+
30+
public void testUsesDescriptionOfNegatedMatcherWithPrefix() {
31+
assertDescription("not a value greater than <2>", not(greaterThan(2)));
32+
assertDescription("not \"A\"", not("A"));
33+
}
34+
}

0 commit comments

Comments
 (0)