Class: Capybara::Queries::TitleQuery Private
- Defined in:
- lib/capybara/queries/title_query.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary
Constants inherited from BaseQuery
Instance Attribute Summary
Attributes inherited from BaseQuery
Instance Method Summary collapse
- #failure_message ⇒ Object private
-
#initialize(expected_title, **options) ⇒ TitleQuery
constructor
private
A new instance of TitleQuery.
- #negative_failure_message ⇒ Object private
- #resolves_for?(node) ⇒ Boolean private
Methods inherited from BaseQuery
#expects_none?, #matches_count?, wait, #wait
Constructor Details
#initialize(expected_title, **options) ⇒ TitleQuery
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of TitleQuery.
7 8 9 10 11 12 13 |
# File 'lib/capybara/queries/title_query.rb', line 7 def initialize(expected_title, **) @expected_title = expected_title.is_a?(Regexp) ? expected_title : expected_title.to_s @options = super(@options) @search_regexp = Capybara::Helpers.to_regexp(@expected_title, all_whitespace: true, exact: .fetch(:exact, false)) assert_valid_keys end |
Instance Method Details
#failure_message ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/capybara/queries/title_query.rb', line 19 def end |
#negative_failure_message ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/capybara/queries/title_query.rb', line 23 def (' not') end |
#resolves_for?(node) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/capybara/queries/title_query.rb', line 15 def resolves_for?(node) (@actual_title = node.title).match(@search_regexp) end |