Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

refix @query_params warning #175

Merged
merged 1 commit into from

2 participants

@bleything

This moves the initialization of @query_params from URIRegexPattern into the URIPattern superclass. That means it'll apply to URIStringPattern as well, which was missed when the warning was silenced last time.

@bblimke bblimke merged commit cd6722c into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 23, 2012
  1. @bleything
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 5 deletions.
  1. +1 −5 lib/webmock/request_pattern.rb
View
6 lib/webmock/request_pattern.rb
@@ -83,6 +83,7 @@ class URIPattern
def initialize(pattern)
@pattern = pattern.is_a?(Addressable::URI) ? pattern : WebMock::Util::URI.normalize_uri(pattern)
+ @query_params = nil
end
def add_query_params(query_params)
@@ -105,11 +106,6 @@ def to_s
end
class URIRegexpPattern < URIPattern
- def initialize *args, &block
- @query_params = nil
- super
- end
-
def matches?(uri)
WebMock::Util::URI.variations_of_uri_as_strings(uri).any? { |u| u.match(@pattern) } &&
(@query_params.nil? || @query_params == uri.query_values)
Something went wrong with that request. Please try again.