Matching on Path
Use the :path
request matcher to match requests on the path portion of the request URI.
You can use this (alone, or in combination with :host
) as an alternative to :uri
so that non-deterministic portions of the URI are not considered as part of the request matching.
Background ()
Given a previously recorded cassette file "cassettes/example.yml" with:
Replay interaction that matches the path
And a file named "path_matching.rb" with:
When I run ruby path_matching.rb
Then it should pass with:
Examples
Last updated