public class ExtraMatchers extends Object
| Constructor and Description |
|---|
ExtraMatchers() |
| Modifier and Type | Method and Description |
|---|---|
static <T> org.hamcrest.Matcher<Iterable<? super T>> |
ordered(List<T> itemMatchers)
|
public static <T> org.hamcrest.Matcher<Iterable<? super T>> ordered(List<T> itemMatchers)
Iterables that matches when consecutive passes over the
examined Iterable yield at least one item that is matched by the corresponding
matcher from the specified itemMatchers. Whilst matching, each traversal of
the examined Iterable will stop as soon as a matching item is found.
For example:
assertThat(Arrays.asList("foo","bar","baz"),hasItems(endsWith("z"),endsWith("o")))
T - the typeitemMatchers - the matchers to apply to items provided by the examined IterableCopyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.