Instantly share code, notes, and snippets.

Embed
What would you like to do?
RSpec::Matchers.define :has_the_same_format_as do |expected|
result = nil
match do |actual|
police = HashPolice::Police.new(expected)
result = police.check(actual)
result.passed?
end
failure_message_for_should do |actual|
result.error_messages
end
end
actual.should has_the_same_format_as(expected)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment