Skip to content

Commit b15c759

Browse files
committed
Failing test for issue #152
1 parent 3691d2b commit b15c759

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

hamcrest/src/test/java/org/hamcrest/beans/HasPropertyWithValueTest.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
package org.hamcrest.beans;
22

3-
import org.hamcrest.*;
3+
import org.hamcrest.AbstractMatcherTest;
4+
import org.hamcrest.Description;
5+
import org.hamcrest.Matcher;
6+
import org.hamcrest.StringDescription;
47
import org.hamcrest.core.IsEqual;
58

69
import java.beans.IntrospectionException;
710
import java.beans.PropertyDescriptor;
811
import java.beans.SimpleBeanInfo;
12+
import java.nio.file.Path;
13+
import java.nio.file.Paths;
914

1015
import static org.hamcrest.MatcherAssert.assertThat;
16+
import static org.hamcrest.Matchers.hasToString;
1117
import static org.hamcrest.Matchers.is;
1218
import static org.hamcrest.beans.HasPropertyWithValue.hasProperty;
1319
import static org.hamcrest.beans.HasPropertyWithValue.hasPropertyAtPath;
@@ -71,6 +77,11 @@ public void testMatchesPath() {
7177
assertMismatchDescription("inner.inner.property.was \"not expected\"", hasPropertyAtPath("inner.inner.property", equalTo("something")), new BeanWithInner(new BeanWithInner(shouldNotMatch)));
7278
}
7379

80+
public void testMatchesAbstract() {
81+
Path path = Paths.get("hi.txt");
82+
assertThat(path, hasProperty("fileName", hasToString("hi.txt")));
83+
}
84+
7485
public void testDescribeTo() {
7586
assertDescription("hasProperty(\"property\", <true>)", hasProperty("property", equalTo(true)));
7687
}

0 commit comments

Comments
 (0)