Skip to content

Bump webmock from 3.38.0 to 3.41.0 - #39

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/bundler/webmock-3.41.0
Open

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/bundler/webmock-3.41.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 27, 2026

Copy link
Copy Markdown

Bumps webmock from 3.38.0 to 3.41.0.

Release notes

Sourced from webmock's releases.

3.41.0

WebMock now parses JSON request bodies with Ruby's JSON.parse, instead of its old parser, which converted JSON to YAML and failed on or misread some valid JSON. Every body pattern that matched on 3.40.0 still matches. If one matches only as the old parser reads the body, WebMock prints a deprecation warning, because 4.0 drops the old parser and the pattern won't match there.

  • Match JSON request bodies with an escaped backslash in a string (#432)

    Previously, a hash body pattern didn't match a JSON body with an escaped backslash inside a string, such as JSON inside JSON, because the old parser failed on it. For example, with(body: {data: '{"url":"/p?a=1\u0026b=2"}'}) didn't match the body {"data":"{\"url\":\"/p?a=1\\u0026b=2\"}"}. It now matches.

    Strings that the old parser changed now match too, for example "a\u000ab", which it read as "a b".

  • Match numbers with an exponent in JSON request bodies

    Previously, a number such as 1e2 or 1e+20 in a JSON body was read as a String, so with(body: {amount: 1e20}) didn't match the body {"amount":1e+20}, which to_json generates for that hash with recent json versions, such as the one in Ruby 4.0. It now matches.

  • Deprecate body patterns that match a JSON request body only as the old parser reads it

    The old parser read some bodies that aren't valid JSON, and some values differently from JSON.parse. For example, with(body: {a: 1}) matches the body {a: 1}, and with(body: {amount: "1e+20"}) matches the body {"amount":1e+20}, because the old parser read that number as a String. Such a pattern still matches, and WebMock prints a warning once for each pattern:

    WebMock deprecation warning: the body pattern {"a" => 1} matched the request body "{a: 1}" only as WebMock's old JSON parser reads it. WebMock 4.0 drops that parser, so it won't match. Send valid JSON, for example from to_json, and write the pattern for what JSON.parse returns.
    

    To fix it, send valid JSON, for example {a: 1}.to_json, and write the pattern for what JSON.parse returns, such as {amount: 1e20}.

  • Don't raise Psych errors for JSON request bodies such as one with an unquoted date

    Previously, with Psych 4 or later (the default since Ruby 3.1), a JSON body such as {"a": 2020-01-01}, which isn't valid JSON, raised Psych::DisallowedClass when a stub had a hash body pattern, instead of WebMock's error for an unregistered request. It now doesn't match the pattern.

  • Name a future major version in the deprecation warning for statuses such as :ok

    The deprecation warning for a status such as :ok, added in 3.38.0, said that WebMock 4.0 would raise ArgumentError for it. 4.0 changes how JSON request bodies are read and doesn't change statuses yet, so the warning now names a future major version.

3.40.0

  • Add support for Curl::Multi (#535)

    Previously, WebMock didn't see requests sent with Curl::Multi. A handle added with multi.add and sent with multi.perform went to the real server, even when a stub matched it or real connections were disabled, and WebMock didn't record it.

    Now a handle that matches a stub gets the stubbed response during multi.perform, and one that is neither stubbed nor allowed raises WebMock::NetConnectNotAllowedError from multi.add. Allowed requests still run together in curb's own multi loop. WebMock records both, and WebMock.after_request callbacks get both.

    If your tests send Curl::Multi requests to real servers, stub them or allow their hosts, for example with WebMock.disable_net_connect!(allow: "api.example.com"). VCR, hooked into WebMock, now records and replays these requests too, and raises VCR::Errors::UnhandledHTTPRequestError for one that a cassette doesn't have, so record such cassettes again.

    Thanks to Todd Fisher

  • Drop curb callbacks on Curl::Easy#reset for stubbed requests, as curb does

    Previously, a callback such as on_complete, set before reset, still ran for a stubbed request made after it. Curb drops every callback on reset, so a real request didn't run it. If your tests rely on such a callback, set it again after reset.

3.39.0

  • Fix tracing libraries that wrap HTTPClient failing on stubbed requests (#1010)

    Previously, for a stubbed request, WebMock's version of HTTPClient's private do_get_block method returned a Thread::Queue instead of the response that HTTPClient's own version returns. Libraries that wrap the method to trace requests, such as Datadog's, read that result as the response.

... (truncated)

Changelog

Sourced from webmock's changelog.

3.41.0

WebMock now parses JSON request bodies with Ruby's JSON.parse, instead of its old parser, which converted JSON to YAML and failed on or misread some valid JSON. Every body pattern that matched on 3.40.0 still matches. If one matches only as the old parser reads the body, WebMock prints a deprecation warning, because 4.0 drops the old parser and the pattern won't match there.

  • Match JSON request bodies with an escaped backslash in a string (#432)

    Previously, a hash body pattern didn't match a JSON body with an escaped backslash inside a string, such as JSON inside JSON, because the old parser failed on it. For example, with(body: {data: '{"url":"/p?a=1\u0026b=2"}'}) didn't match the body {"data":"{\"url\":\"/p?a=1\\u0026b=2\"}"}. It now matches.

    Strings that the old parser changed now match too, for example "a\u000ab", which it read as "a b".

  • Match numbers with an exponent in JSON request bodies

    Previously, a number such as 1e2 or 1e+20 in a JSON body was read as a String, so with(body: {amount: 1e20}) didn't match the body {"amount":1e+20}, which to_json generates for that hash with recent json versions, such as the one in Ruby 4.0. It now matches.

  • Deprecate body patterns that match a JSON request body only as the old parser reads it

    The old parser read some bodies that aren't valid JSON, and some values differently from JSON.parse. For example, with(body: {a: 1}) matches the body {a: 1}, and with(body: {amount: "1e+20"}) matches the body {"amount":1e+20}, because the old parser read that number as a String. Such a pattern still matches, and WebMock prints a warning once for each pattern:

    WebMock deprecation warning: the body pattern {"a" => 1} matched the request body "{a: 1}" only as WebMock's old JSON parser reads it. WebMock 4.0 drops that parser, so it won't match. Send valid JSON, for example from to_json, and write the pattern for what JSON.parse returns.
    

    To fix it, send valid JSON, for example {a: 1}.to_json, and write the pattern for what JSON.parse returns, such as {amount: 1e20}.

  • Don't raise Psych errors for JSON request bodies such as one with an unquoted date

    Previously, with Psych 4 or later (the default since Ruby 3.1), a JSON body such as {"a": 2020-01-01}, which isn't valid JSON, raised Psych::DisallowedClass when a stub had a hash body pattern, instead of WebMock's error for an unregistered request. It now doesn't match the pattern.

  • Name a future major version in the deprecation warning for statuses such as :ok

    The deprecation warning for a status such as :ok, added in 3.38.0, said that WebMock 4.0 would raise ArgumentError for it. 4.0 changes how JSON request bodies are read and doesn't change statuses yet, so the warning now names a future major version.

3.40.0

  • Add support for Curl::Multi (#535)

    Previously, WebMock didn't see requests sent with Curl::Multi. A handle added with multi.add and sent with multi.perform went to the real server, even when a stub matched it or real connections were disabled, and WebMock didn't record it.

    Now a handle that matches a stub gets the stubbed response during multi.perform, and one that is neither stubbed nor allowed raises WebMock::NetConnectNotAllowedError from multi.add. Allowed requests still run together in curb's own multi loop. WebMock records both, and WebMock.after_request callbacks get both.

    If your tests send Curl::Multi requests to real servers, stub them or allow their hosts, for example with WebMock.disable_net_connect!(allow: "api.example.com"). VCR, hooked into WebMock, now records and replays these requests too, and raises VCR::Errors::UnhandledHTTPRequestError for one that a cassette doesn't have, so record such cassettes again.

    Thanks to Todd Fisher

  • Drop curb callbacks on Curl::Easy#reset for stubbed requests, as curb does

    Previously, a callback such as on_complete, set before reset, still ran for a stubbed request made after it. Curb drops every callback on reset, so a real request didn't run it. If your tests rely on such a callback, set it again after reset.

3.39.0

... (truncated)

Commits
  • 6186a70 Version 3.41.0
  • 25de467 Say a future major version will raise for statuses such as :ok
  • fc6d039 Parse JSON request bodies with JSON.parse (#432)
  • 96bdaf5 Merge pull request #1151 from dpep/finish-spec-stub-cleanup
  • e0d9b24 Drop restated defaults from em-http and http.rb spec stubs
  • b27a398 Merge pull request #1150 from dpep/simplify-response-stubs
  • 972c9e2 Simplify response stubs in the curb and httpclient specs
  • f114e3f Version 3.40.0
  • 28f4be8 Finish Curl::Multi#perform when a stubbed handle is reset or closed
  • 057ce36 Pass the multi to the Curl::Multi#perform block, as curb does
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [webmock](https://github.com/bblimke/webmock) from 3.38.0 to 3.41.0.
- [Release notes](https://github.com/bblimke/webmock/releases)
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](bblimke/webmock@v3.38.0...v3.41.0)

---
updated-dependencies:
- dependency-name: webmock
  dependency-version: 3.41.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file ruby Pull requests that update ruby code labels Nov 27, 2026
@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file ruby Pull requests that update ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants