Permalink
Browse files

Merge pull request #175 from bleything/warnings

refix @query_params warning
  • Loading branch information...
bblimke committed Apr 28, 2012
2 parents 4711a0b + 8989b85 commit cd6722c2a25893e1c23e24d9daebe9dc42b082f1
Showing with 1 addition and 5 deletions.
  1. +1 −5 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)

0 comments on commit cd6722c

Please sign in to comment.