package org.hamcrest; | |
import org.junit.Test; | |
import static org.junit.Assert.assertEquals; | |
public final class BaseMatcherTest { | |
@Test | |
public void | |
describesItselfWithToStringMethod() { | |
Matcher<Object> someMatcher = new BaseMatcher<Object>() { | |
@Override | |
public boolean matches(Object item) { | |
throw new UnsupportedOperationException(); | |
} | |
@Override | |
public void describeTo(Description description) { | |
description.appendText("SOME DESCRIPTION"); | |
} | |
}; | |
assertEquals("SOME DESCRIPTION", someMatcher.toString()); | |
} | |
} |