Public class methods
new
(expected)
[show source]
# File lib/webrat/selenium/matchers/have_selector.rb, line 5 def initialize(expected) @expected = expected end
Public instance methods
failure_message
()
Returns
| String: | The failure message. |
[show source]
# File lib/webrat/selenium/matchers/have_selector.rb, line 19 def failure_message "expected following text to match selector #{@expected}:\n#{@document}" end
matches?
(response)
[show source]
# File lib/webrat/selenium/matchers/have_selector.rb, line 9 def matches?(response) response.session.wait_for do response.selenium.is_element_present("css=#{@expected}") end rescue Webrat::TimeoutError false end
negative_failure_message
()
Returns
| String: | The failure message to be displayed in negative matches. |
[show source]
# File lib/webrat/selenium/matchers/have_selector.rb, line 25 def negative_failure_message "expected following text to not match selector #{@expected}:\n#{@document}" end