Class: Capybara::Queries::TitleQuery

### Home Classes Methods

### In Files

- lib/capybara/queries/title_query.rb

### Parent

Capybara::Queries::BaseQuery

### Methods

- ::new
- #failure_message
- #negative_failure_message
- #resolves_for?

### Files

- another_test_file.txt
- test_file.txt

### Class/Module Index

Quicksearch

- Capybara
- Capybara::Ambiguous
- Capybara::CapybaraError
- Capybara::DSL
- Capybara::Driver
- Capybara::Driver::Base
- Capybara::Driver::Node
- Capybara::DriverNotFoundError
- Capybara::ElementNotFound
- Capybara::ExpectationNotMet
- Capybara::Features
- Capybara::FileNotFound
- Capybara::FrozenInTime
- Capybara::Helpers
- Capybara::InfiniteRedirectError
- Capybara::ModalNotFound
- Capybara::Node
- Capybara::Node::Actions
- Capybara::Node::Base
- Capybara::Node::Document
- Capybara::Node::DocumentMatchers
- Capybara::Node::Element
- Capybara::Node::Finders
- Capybara::Node::Matchers
- Capybara::Node::Simple
- Capybara::NotSupportedByDriverError
- Capybara::Queries
- Capybara::Queries::BaseQuery
- Capybara::Queries::TextQuery
- Capybara::Queries::TitleQuery
- Capybara::Query
- Capybara::RSpecMatchers
- Capybara::RSpecMatchers::BecomeClosed
- Capybara::RSpecMatchers::HaveSelector
- Capybara::RSpecMatchers::HaveText
- Capybara::RSpecMatchers::HaveTitle
- Capybara::RSpecMatchers::Matcher
- Capybara::RackTest
- Capybara::RackTest::Browser
- Capybara::RackTest::CSSHandlers
- Capybara::RackTest::Driver
- Capybara::RackTest::Form
- Capybara::RackTest::Form::NilUploadedFile
- Capybara::RackTest::Node
- Capybara::ReadOnlyElementError
- Capybara::Result
- Capybara::ScopeError
- Capybara::Selector
- Capybara::Selector::Filter
- Capybara::Selenium
- Capybara::Selenium::Driver
- Capybara::Selenium::Node
- Capybara::Server
- Capybara::Server::Middleware
- Capybara::Session
- Capybara::SpecHelper
- Capybara::UnselectNotAllowed
- Capybara::Window
- Capybara::WindowError
- TestApp
- TestApp::TestAppError
- Object

No matching classes.

# Capybara::Queries::TitleQuery

### Public Class Methods

new(expected_title, options = {}) click to toggle source

    # File lib/capybara/queries/title_query.rb, line 5
    def initialize(expected_title, options = {})
      @expected_title = expected_title
      @options = options
      unless @expected_title.is_a?(Regexp)
        @expected_title = Capybara::Helpers.normalize_whitespace(@expected_title)
      end
      @search_regexp = Capybara::Helpers.to_regexp(@expected_title)
      assert_valid_keys
    end

### Public Instance Methods

failure_message() click to toggle source

    # File lib/capybara/queries/title_query.rb, line 20
    def failure_message
      failure_message_helper
    end

negative_failure_message() click to toggle source

    # File lib/capybara/queries/title_query.rb, line 24
    def negative_failure_message
      failure_message_helper(' not')
    end

resolves_for?(node) click to toggle source

    # File lib/capybara/queries/title_query.rb, line 15
    def resolves_for?(node)
      @actual_title = node.title
      @actual_title.match(@search_regexp)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.