query_parser
By default, VCR will parse query strings using CGI.parse
from the Ruby standard library. This may not be the most optimal or performant library available. You can set the query_parser
configuration option to use a different parser (such as Rack::Utils.method(:parse_query)
) to decode, normalize, and/or provide a comparison object for query strings.
The configured query parser needs to expose a .call
method that returns an object which is comparable. This instance needs to implement the following API:
#==
=> boolean
Background ()
Given a file named "cassettes/example.yml" with:
the VCR query parser gets its value from query_parser
query_parser
Given a file named "query_parser.rb" with:
When I run ruby query_parser.rb
Then it should fail with an error like:
the query_parser
defaults to the standard library's CGI.parse
query_parser
defaults to the standard library's CGI.parse
Given a file named "query_parser_default.rb" with:
When I run ruby query_parser_default.rb
Then it should pass with "Hello".
Last updated