module Capybara::Node::DocumentMatchers

def _verify_title(title, options)

def _verify_title(title, options)
  query = Capybara::Queries::TitleQuery.new(title, options)
  synchronize(query.wait) do
    yield(query)
  end
  return true
end

def assert_no_title(title, **options)

Returns:
  • (true) -

Raises:
  • (Capybara::ExpectationNotMet) - if the assertion hasn't succeeded during wait time
def assert_no_title(title, **options)
  _verify_title(title, options) { |query| raise Capybara::ExpectationNotMet, query.negative_failure_message if query.resolves_for?(self) }
end

def assert_title(title, **options)

Returns:
  • (true) -

Raises:
  • (Capybara::ExpectationNotMet) - if the assertion hasn't succeeded during wait time

Options Hash: (**options)
  • :exact (Boolean) -- When passed a string should the match be exact or just substring
  • :wait (Numeric) -- Maximum time that Capybara will wait for title to eq/match given string/regexp argument

Parameters:
  • regexp (Regexp) -- The regexp that title should match to
  • string (String) -- The string that title should include

Overloads:
  • assert_title(regexp, options = {})
  • assert_title(string, options = {})
def assert_title(title, **options)
  _verify_title(title, options) { |query| raise Capybara::ExpectationNotMet, query.failure_message unless query.resolves_for?(self) }
end

def has_no_title?(title, **options)

Returns:
  • (Boolean) -
def has_no_title?(title, **options)
  assert_no_title(title, options)
rescue Capybara::ExpectationNotMet
  return false
end

def has_title?(title, **options)

Returns:
  • (Boolean) -
def has_title?(title, **options)
  assert_title(title, options)
rescue Capybara::ExpectationNotMet
  return false
end