gems webmock 3.32.0

4 hours ago
  • Make a Net::HTTP object created while WebMock was enabled behave like any other Net::HTTP object after WebMock.disable! (#1067)

    Such an object, like a connection cached by net-http-persistent or by Capybara with Selenium, used to raise ArgumentError on start or a stubbed request, and WebMock::NetConnectNotAllowedError on any other request, after WebMock was disabled. It now sends real requests until WebMock is enabled again.

    Thanks to Mike Taylor and James Rodovich

  • Connect again when a request is retried on a Net::HTTP object that WebMock started without connecting and whose first real connection failed

    Such a retry used to raise NoMethodError (undefined method closed? for nil). It now tries to connect again, and raises the connection error if that fails too.

  • Drop the Transfer-Encoding header from stubbed async-http responses, as WebMock already does with Content-Length (#1044)

    A stub with a Transfer-Encoding header, such as chunked, used to fail with "Message contains both transfer encoding and content length". async-http sets both headers itself from the body, and its responses from real servers don't include them either.

    Thanks to Tim Mertens

  • Record requests made with curb's http_patch as PATCH requests with their body (#1112)

    curb has http_patch since 1.0.8. WebMock recorded such a request as a GET, or as a POST after post_body=, so a PATCH stub never matched it.

    Thanks to Andy Williams

  • Record a curb request sent without a body as having none, even after an earlier http_post or http_patch call with a body on the same Curl::Easy object

    For example, after c.http_post("a=1"), c.reset and c.http(:POST), the second request was recorded with the body a=1, so a stub for that body matched it.

Don't miss a new webmock release

NewReleases is sending notifications on new releases.