-
Allow narrowing an RSpec expectation on a stub with
with, as inexpect(stub).to have_been_requested.once.with(body: "abc")(#1128)The expectation counts only the requests that match both the stub and the conditions given to
with. The stub itself does not change.Thanks to Sébastien S.
-
Show the JSON body hint for expectations narrowed with
withtoo, and no longer show it when a block is given to the stub or expectation, since checking would mean calling the block -
Allow a full URL with a path in
disable_net_connect!(allow: ...), as inallow: "https://github.com/mozilla/geckodriver/releases/latest"(#977)URLs are compared the same way as in stubs, so the default port, letter case in the host, and the order and encoding of query parameters don't matter. A URL without a path or query allows every path on that scheme, host and port; a trailing slash restricts requests to
/with no query string. Credentials in either URL are ignored.Thanks to Henry Blyth