Skip to content

Commit

Permalink
Fix "warning: instance variable @query_params not initialized" warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Van Dyk committed Jan 23, 2012
1 parent ad9ea7f commit e459569
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/webmock/request_pattern.rb
Expand Up @@ -79,6 +79,10 @@ def initialize(pattern)
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) } &&
Expand Down

0 comments on commit e459569

Please sign in to comment.