Skip to content

Instantly share code, notes, and snippets.

Created January 14, 2009 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/46868 to your computer and use it in GitHub Desktop.
Save anonymous/46868 to your computer and use it in GitHub Desktop.
module Matchers
class HaveNotice
def initialize(contents)
@contents = contents
end
def matches?(response)
response.should have_tag('div.notice', @contents)
end
def failure_message
"expected response to contain #{@contents} but it didn't"
end
def negative_failure_message
"expected response to not contain #{@contents} but it did"
end
end
def have_notice(contents)
HaveNotice.new(contents)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment