From 10b31be511f7d93669c2dd6defd0a39abc3d111b Mon Sep 17 00:00:00 2001 From: Amos King Date: Fri, 9 Jan 2009 22:14:12 -0600 Subject: [PATCH] remove duplicated code from the Has Content matchers in selenium matchers file. --- lib/webrat/selenium/matchers.rb | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/lib/webrat/selenium/matchers.rb b/lib/webrat/selenium/matchers.rb index a3d38f8..53455b9 100644 --- a/lib/webrat/selenium/matchers.rb +++ b/lib/webrat/selenium/matchers.rb @@ -59,10 +59,6 @@ module Webrat end class HasContent #:nodoc: - def initialize(content) - @content = content - end - def matches?(response) if @content.is_a?(Regexp) text_finder = "regexp:#{@content.source}" @@ -74,33 +70,6 @@ module Webrat response.selenium.is_text_present(text_finder) end end - - # ==== Returns - # String:: The failure message. - def failure_message - "expected the following element's content to #{content_message}:\n#{@element}" - end - - # ==== Returns - # String:: The failure message to be displayed in negative matches. - def negative_failure_message - "expected the following element's content to not #{content_message}:\n#{@element}" - end - - def content_message - case @content - when String - "include \"#{@content}\"" - when Regexp - "match #{@content.inspect}" - end - end - end - - # Matches the contents of an HTML document with - # whatever string is supplied - def contain(content) - HasContent.new(content) end end