Created
January 14, 2009 11:32
-
-
Save anonymous/46868 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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