Skip to content

4.3.0

Latest

Choose a tag to compare

@bblimke bblimke released this 04 Dec 19:46
  • Allow real requests except to destinations listed in disallow: (#1058)

    WebMock.allow_net_connect!(disallow: ["billing.example.com"]) lets tests reach other hosts. When WebMock intercepts a request to the billing host, it raises WebMock::NetConnectNotAllowedError unless a stub matches. disallow: accepts the same matchers as allow:.

    Thanks to sandfortw for the suggestion

  • Fix RequestStub#then silently ignoring its block (#1037)

    Previously, stub.then { |s| s.with(query: {page: "1"}) } ignored the block. The stub now requires page=1, so a request without it no longer matches. With a block, then returns the block's result. Without a block, it still chains responses as before.

  • Fix Excon splitting stubbed chunks when Transfer-Encoding is ["gzip", "chunked"]

    WebMock now keeps transfer encodings in the order you specify. With body_chunks: ["ab", "cd"] and Excon's chunk_size: 1, the streaming callback now receives "ab" and "cd". Previously it received four single bytes.