class DictKeyMatcher defm match(expected, actual) return has_key(actual, expected) end defm failure_message_for_match(expected, actual) return "expected object to have key “#{expected}”" end defm failure_message_for_mismatch(expected, actual) return "expected object to not have key “#{expected}”" end end