Skip to content

Commit f2670f8

Browse files
author
joeretro
committed
Rename: classCompatibleWith() -> typeCompatibleWith()
1 parent 8d168e5 commit f2670f8

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/library/org/hamcrest/object/IsCompatibleType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void describeTo(Description description) {
2121
}
2222

2323
@Factory
24-
public static <T> Matcher<Class<?>> classCompatibleWith(Class<T> baseType) {
24+
public static <T> Matcher<Class<?>> typeCompatibleWith(Class<T> baseType) {
2525
return new IsCompatibleType<T>(baseType);
2626
}
2727
}

src/unit-test/org/hamcrest/object/IsCompatibleTypeTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.hamcrest.AbstractMatcherTest;
44
import org.hamcrest.Matcher;
55
import static org.hamcrest.MatcherAssert.assertThat;
6-
import static org.hamcrest.object.IsCompatibleType.classCompatibleWith;
6+
import static org.hamcrest.object.IsCompatibleType.typeCompatibleWith;
77

88
public class IsCompatibleTypeTest extends AbstractMatcherTest {
99
public static class BaseClass {
@@ -22,27 +22,27 @@ public static class ClassImplementingBaseInterface implements BaseInterface {
2222
}
2323

2424
protected Matcher<?> createMatcher() {
25-
return classCompatibleWith(BaseClass.class);
25+
return typeCompatibleWith(BaseClass.class);
2626
}
2727

2828
public void testMatchesSameClass() {
29-
assertThat(BaseClass.class, classCompatibleWith(BaseClass.class));
29+
assertThat(BaseClass.class, typeCompatibleWith(BaseClass.class));
3030
}
3131

3232
public void testMatchesSameInterface() {
33-
assertThat(BaseInterface.class, classCompatibleWith(BaseInterface.class));
33+
assertThat(BaseInterface.class, typeCompatibleWith(BaseInterface.class));
3434
}
3535

3636
public void testMatchesExtendedClass() {
37-
assertThat(ExtendedClass.class, classCompatibleWith(BaseClass.class));
37+
assertThat(ExtendedClass.class, typeCompatibleWith(BaseClass.class));
3838
}
3939

4040
public void testMatchesClassImplementingInterface() {
41-
assertThat(ClassImplementingBaseInterface.class, classCompatibleWith(BaseInterface.class));
41+
assertThat(ClassImplementingBaseInterface.class, typeCompatibleWith(BaseInterface.class));
4242
}
4343

4444
public void testMatchesExtendedInterface() {
45-
assertThat(ExtendedInterface.class, classCompatibleWith(BaseInterface.class));
45+
assertThat(ExtendedInterface.class, typeCompatibleWith(BaseInterface.class));
4646
}
4747

4848
// public void testDoesNotMatchIncompatibleTypes() {
@@ -51,6 +51,6 @@ public void testMatchesExtendedInterface() {
5151
// }
5252

5353
public void testHasReadableDescription() {
54-
assertDescription("type < java.lang.Runnable", classCompatibleWith(Runnable.class));
54+
assertDescription("type < java.lang.Runnable", typeCompatibleWith(Runnable.class));
5555
}
5656
}

0 commit comments

Comments
 (0)