Class: Capybara::Queries::TitleQuery Private
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
BaseQuery
|
|
Instance Chain:
self,
BaseQuery
|
|
Inherits: |
Capybara::Queries::BaseQuery
|
Defined in: | lib/capybara/queries/title_query.rb |
Constant Summary
BaseQuery
- Inherited
Class Method Summary
- .new(expected_title, **options) ⇒ TitleQuery constructor Internal use only
BaseQuery
- Inherited
Instance Attribute Summary
BaseQuery
- Inherited
#expects_none? | Checks if a count of 0 is valid for the query Returns false if query does not have any count options specified. |
#options, #session_options, #session_options=, #count_specified? |
Instance Method Summary
- #failure_message Internal use only
- #negative_failure_message Internal use only
- #resolves_for?(node) ⇒ Boolean Internal use only
- #failure_message_helper(negated = '') private Internal use only
- #valid_keys private Internal use only
BaseQuery
- Inherited
#failure_message | Generates a failure message from the query description and count options. |
#matches_count? | Checks if the given count matches the query count options. |
#negative_failure_message, #wait, #assert_valid_keys, #count_message, #occurrences |
Constructor Details
.new(expected_title, **options) ⇒ TitleQuery
# 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 = Helpers.to_regexp(@expected_title, all_whitespace: true, exact: .fetch(:exact, false)) assert_valid_keys end
Instance Method Details
#failure_message
[ GitHub ]# File 'lib/capybara/queries/title_query.rb', line 19
def end
#failure_message_helper(negated = '') (private)
[ GitHub ]# File 'lib/capybara/queries/title_query.rb', line 29
def (negated = '') verb = @expected_title.is_a?(Regexp) ? 'match' : 'include' "expected #{@actual_title.inspect}#{negated} to #{verb} #{@expected_title.inspect}" end
#negative_failure_message
[ GitHub ]# File 'lib/capybara/queries/title_query.rb', line 23
def (' not') end
#resolves_for?(node) ⇒ Boolean
# File 'lib/capybara/queries/title_query.rb', line 15
def resolves_for?(node) (@actual_title = node.title).match?(@search_regexp) end
#valid_keys (private)
[ GitHub ]# File 'lib/capybara/queries/title_query.rb', line 34
def valid_keys %i[wait exact] end