|
1 | 1 | package org.hamcrest.beans; |
2 | 2 |
|
3 | | -import org.hamcrest.*; |
| 3 | +import org.hamcrest.AbstractMatcherTest; |
| 4 | +import org.hamcrest.Description; |
| 5 | +import org.hamcrest.Matcher; |
| 6 | +import org.hamcrest.StringDescription; |
4 | 7 | import org.hamcrest.core.IsEqual; |
5 | 8 |
|
6 | 9 | import java.beans.IntrospectionException; |
7 | 10 | import java.beans.PropertyDescriptor; |
8 | 11 | import java.beans.SimpleBeanInfo; |
| 12 | +import java.nio.file.Path; |
| 13 | +import java.nio.file.Paths; |
9 | 14 |
|
10 | 15 | import static org.hamcrest.MatcherAssert.assertThat; |
| 16 | +import static org.hamcrest.Matchers.hasToString; |
11 | 17 | import static org.hamcrest.Matchers.is; |
12 | 18 | import static org.hamcrest.beans.HasPropertyWithValue.hasProperty; |
13 | 19 | import static org.hamcrest.beans.HasPropertyWithValue.hasPropertyAtPath; |
@@ -71,6 +77,11 @@ public void testMatchesPath() { |
71 | 77 | assertMismatchDescription("inner.inner.property.was \"not expected\"", hasPropertyAtPath("inner.inner.property", equalTo("something")), new BeanWithInner(new BeanWithInner(shouldNotMatch))); |
72 | 78 | } |
73 | 79 |
|
| 80 | + public void testMatchesAbstract() { |
| 81 | + Path path = Paths.get("hi.txt"); |
| 82 | + assertThat(path, hasProperty("fileName", hasToString("hi.txt"))); |
| 83 | + } |
| 84 | + |
74 | 85 | public void testDescribeTo() { |
75 | 86 | assertDescription("hasProperty(\"property\", <true>)", hasProperty("property", equalTo(true))); |
76 | 87 | } |
|
0 commit comments