Class: WebMock::URIAddressablePattern
Instance Method Summary
collapse
Methods inherited from URIPattern
#initialize
#rSpecHashExcludingMatcher?, #rSpecHashIncludingMatcher?
Instance Method Details
#add_query_params(query_params) ⇒ Object
166
167
168
169
170
171
172
173
|
# File 'lib/webmock/request_pattern.rb', line 166
def add_query_params(query_params)
@@add_query_params_warned ||= false
if not @@add_query_params_warned
@@add_query_params_warned = true
warn "WebMock warning: ignoring query params in RFC 6570 template and checking them with WebMock"
end
super(query_params)
end
|
#matches?(uri) ⇒ Boolean
155
156
157
158
159
160
161
162
163
164
|
# File 'lib/webmock/request_pattern.rb', line 155
def matches?(uri)
if @query_params.nil?
matches_with_variations?(uri)
else
matches_with_variations?(uri.omit(:query)) &&
@query_params == WebMock::Util::QueryMapper.query_to_values(uri.query)
end
end
|
#to_s ⇒ Object
175
176
177
178
179
|
# File 'lib/webmock/request_pattern.rb', line 175
def to_s
str = @pattern.pattern.inspect
str += " with variables #{@pattern.variables.inspect}" if @pattern.variables
str
end
|