Skip to content

Instantly share code, notes, and snippets.

@andyferra
Created October 8, 2010 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyferra/617721 to your computer and use it in GitHub Desktop.
Save andyferra/617721 to your computer and use it in GitHub Desktop.
def rhyme_with(expected)
simple_matcher do |given, matcher|
matcher.description = "rhyme with #{expected.inspect}"
matcher.failure_message = "expected #{given.inspect} to rhyme with #{expected.inspect}"
matcher.negative_failure_message = "expected #{given.inspect} not to rhyme with #{expected.inspect}"
given.rhymes_with? expected
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment