Skip to content

Commit

Permalink
Document contains_all_of matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
povilasb committed Jan 18, 2018
1 parent a598e48 commit 75bb683
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/matchers/vecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,19 @@ fn is_next_index(current_index: &usize, previous_index: &Option<usize>) -> bool
return true;
}

/// Creates a matcher that checks if actual vector has all items of the given vector.
///
/// # Examples
///
/// ```
/// #[macro_use] extern crate hamcrest;
/// use hamcrest::prelude::*;
///
/// fn main() {
/// assert_that!(&vec![1, 2, 3, 4], contains_all_of(vec![1, 2, 3]));
/// assert_that!(&vec![1, 2, 3], does_not(contain_all_of(vec![1, 2, 4])));
/// }
/// ```
pub fn contains_all_of<T>(items: Vec<T>) -> Contains<T> {
Contains {
items: items,
Expand Down

0 comments on commit 75bb683

Please sign in to comment.