myronmarston/vcr — pull request #216 by nbibler (2012-11-25 21:55:55+00:00)
Title: Add a built-in query string matcher

This pull request adds a built-in VCR matcher for query string comparisons (called `query`). The ordering of the query string parameters does not matter, and this matcher does not account for request methods or any other URI attribute (hostname, port, etc.).

The usage is as follows:

```ruby
VCR.configure do |c|
c.default_cassette_options = { :match_requests_on => [:query] }
end
```

By default, this matcher uses the Ruby standard library's `CGI.parse` to convert the String into a Hash for comparison, but that may be overridden by the new VCR.configuration setting of `query_parser`:

```ruby
VCR.configure do |c|
c.query_parser = Rack::Utils.method(:parse_query)
end
```

The only requirement of the query_parser setting is that it responds to `call` where it will pass the String-form of the query. It is expected that the result of that call may be correctly compared.