class Capybara::Queries::TextQuery

def build_message(report_on_invisible)

def build_message(report_on_invisible)
  message = "".dup
  unless (COUNT_KEYS & @options.keys).empty?
    message << " but found #{@count} #{Capybara::Helpers.declension('time', 'times', @count)}"
  end
  message << " in #{@actual_text.inspect}"
  details_message = []
  details_message << case_insensitive_message if @node and !@expected_text.is_a? Regexp
  details_message << invisible_message if @node and check_visible_text? and report_on_invisible
  details_message.compact!
  message << ". (However, #{details_message.join(' and ')}.)" unless details_message.empty?
  message
end