Class: Capybara::Queries::CurrentPathQuery Private
- Defined in:
- lib/capybara/queries/current_path_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_path, options = {}) ⇒ CurrentPathQuery
constructor
private
A new instance of CurrentPathQuery.
- #negative_failure_message ⇒ Object private
- #resolves_for?(session) ⇒ Boolean private
Methods inherited from BaseQuery
Constructor Details
#initialize(expected_path, options = {}) ⇒ CurrentPathQuery
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 CurrentPathQuery.
8 9 10 11 12 13 14 |
# File 'lib/capybara/queries/current_path_query.rb', line 8 def initialize(expected_path, = {}) @expected_path = expected_path @options = { url: false, only_path: false }.merge() 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.
34 35 36 |
# File 'lib/capybara/queries/current_path_query.rb', line 34 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.
38 39 40 |
# File 'lib/capybara/queries/current_path_query.rb', line 38 def (' not') end |
#resolves_for?(session) ⇒ 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.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/capybara/queries/current_path_query.rb', line 16 def resolves_for?(session) @actual_path = if [:url] session.current_url else if [:only_path] ::Addressable::URI.parse(session.current_url).path else ::Addressable::URI.parse(session.current_url).request_uri end end if @expected_path.is_a? Regexp @actual_path.match(@expected_path) else ::Addressable::URI.parse(@expected_path) == Addressable::URI.parse(@actual_path) end end |