Class: WebMock::URIRegexpPattern
- Inherits:
-
URIPattern
- Object
- URIPattern
- WebMock::URIRegexpPattern
- Defined in:
- lib/webmock/request_pattern.rb
Instance Method Summary collapse
Methods inherited from URIPattern
#add_query_params, #initialize
Methods included from RSpecMatcherDetector
#rSpecHashExcludingMatcher?, #rSpecHashIncludingMatcher?
Constructor Details
This class inherits a constructor from WebMock::URIPattern
Instance Method Details
#matches?(uri) ⇒ Boolean
142 143 144 145 |
# File 'lib/webmock/request_pattern.rb', line 142 def matches?(uri) WebMock::Util::URI.variations_of_uri_as_strings(uri).any? { |u| u.match(@pattern) } && (@query_params.nil? || @query_params == WebMock::Util::QueryMapper.query_to_values(uri.query, notation: Config.instance.query_values_notation)) end |
#to_s ⇒ Object
147 148 149 150 151 |
# File 'lib/webmock/request_pattern.rb', line 147 def to_s str = @pattern.inspect str += " with query params #{@query_params.inspect}" if @query_params str end |