isIn function

Matcher isIn (dynamic expected)

Returns a matcher that matches if the match argument is in the expected value. This is the converse of contains.

Implementation

Matcher isIn(expected) {
  if (expected is Iterable) {
    return _In(expected, expected.contains);
  } else if (expected is String) {
    return _In<Pattern>(expected, expected.contains);
  } else if (expected is Map) {
    return _In(expected, expected.containsKey);
  }

  throw ArgumentError.value(
      expected, 'expected', 'Only Iterable, Map, and String are supported.');
}