peterlck / hamcrest

Automatically exported from code.google.com/p/hamcrest
0 stars 0 forks source link

hasItem is not working #195

Closed GoogleCodeExporter closed 10 years ago

GoogleCodeExporter commented 10 years ago
I just test the example given in the javadoc of hamcrest, It seems hasItem does 
not work properly !

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.startsWith;
import java.util.Arrays;
import org.junit.Test;

public class Tester
{

    @Test
    public void test(){
        assertThat(Arrays.asList("foo", "bar"), hasItem(startsWith( "bar")));
    }

}

Original issue reported on code.google.com by mohamed....@gmail.com on 8 Apr 2013 at 12:01