Skip to content

Instantly share code, notes, and snippets.

@dchelimsky
Forked from anonymous/gist:46868
Created January 14, 2009 22:18
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 dchelimsky/47126 to your computer and use it in GitHub Desktop.
Save dchelimsky/47126 to your computer and use it in GitHub Desktop.
module Matchers
class HaveNotice
def initialize(contents, scope)
@contents, @scope = contents, scope
end
def matches?(response)
response.should @scope.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, self)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment