bblimke/webmock — pull request #157 by jenmei (2012-01-30 23:58:40+00:00)
Title: Test for supporting various conventions for array fields

For our purposes, we've been attempting to use VCR/WebMock to playback requests to the Echo Nest API.

Some of their API methods take parameters w/ multiple values, e.g. see bucket, http://developer.echonest.com/docs/v4/artist.html, http://developer.echonest.com/api/v4/artist/profile?api_key=N6E4NIOVYMTHNDM8J&id=ARH6W4X1187B99274F&format=json&bucket=biographies&bucket=blogs&bucket=familiarity&bucket=hotttnesss&bucket=images&bucket=news&bucket=reviews&bucket=terms&bucket=urls&bucket=video&bucket=id:rdio-us-streaming.

In several places (`WebMock::Util::URI.normalize_uri` or `#matches?` methods from `WebMock::URIPattern` subclasses), WebMock uses a Hash to set an Addressable::URI instance's query_values. The fallout from this approach is that with a query string a la `?a=1&a=2`, since a Ruby hash has unique keys, information is lost when duplicate keys exist, i.e. `?a=1&a=2` translates to `query_values` of something like `{ 'a' => '2' }`.

Consequently, we're unable to use WebMock because several param key/value pairs are missing, resulting in unexpected response values.