sameAs function

ContextAwareMatcher sameAs (
  1. String key
)

Asserts that for a key x, the value of x is equal to the value for key.

Implementation

ContextAwareMatcher sameAs(String key) {
  return predicateWithContext(
    (item, key, context, matchState) {
      return equals(item).matches(context[key], matchState);
    },
    'is equal to the value of "$key"',
  );
}