Skip to content

Instantly share code, notes, and snippets.

@drnic
Created July 5, 2010 12:31
Show Gist options
  • Select an option

  • Save drnic/464304 to your computer and use it in GitHub Desktop.

Select an option

Save drnic/464304 to your computer and use it in GitHub Desktop.
module Matchers
def contain(expected)
simple_matcher("contain #{expected.inspect}") do |given, matcher|
matcher.failure_message = "expected #{given.inspect} to contain #{expected.inspect}"
matcher.negative_failure_message = "expected #{given.inspect} not to contain #{expected.inspect}"
given.index expected
end
end
end
World(Matchers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment