Skip to content

Instantly share code, notes, and snippets.

@mbbx6spp
Created July 30, 2009 21:34
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 mbbx6spp/158946 to your computer and use it in GitHub Desktop.
Save mbbx6spp/158946 to your computer and use it in GitHub Desktop.
# template for Spec Matcher
Spec::Matchers.define :be_an_alien do |planet|
match do |creature|
creature.alien_of?(planet)
end
failure_message_for_should do |creature|
"expected that #{creature} would be an alien of #{planet}"
end
failure_message_for_should_not do |creature|
"expected that #{creature} would not be an alien of #{planet}"
end
description do
"be an alien of #{planet}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment