~brian-thomason/+junk/hamcrest

« back to all changes in this revision

Viewing changes to hamcrest-unit-test/src/main/java/org/hamcrest/CustomMatcherTest.java

  • Committer: Brian Thomason
  • Date: 2011-12-20 17:40:16 UTC
  • Revision ID: brian.thomason@canonical.com-20111220174016-g67bgjybqqhzuuxt
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.hamcrest;
 
2
 
 
3
import static org.hamcrest.AbstractMatcherTest.assertDescription;
 
4
import junit.framework.TestCase;
 
5
 
 
6
public class CustomMatcherTest extends TestCase {
 
7
 
 
8
    public void testUsesStaticDescription() throws Exception {
 
9
        Matcher<String> matcher = new CustomMatcher<String>("I match strings") {
 
10
            public boolean matches(Object item) {
 
11
                return (item instanceof String);
 
12
            }
 
13
        };
 
14
 
 
15
        assertDescription("I match strings", matcher);
 
16
    }
 
17
}