JavaHamcrest
JavaHamcrest copied to clipboard
issue with containg
the line assertThat(Arrays.asList(1,1), org.hamcrest.Matchers.contains(1));
fail.
This is the intended behaviour. contains only matches if all parameters have a one-to-one correspondence to the list elements. So this would work:
assertThat(Arrays.asList(1,1), org.hamcrest.Matchers.contains(1, 1));
To check if the list has at least one element use
assertThat(Arrays.asList(1,1), org.hamcrest.Matchers.hasItem(1));
#140 ;)