utkarshkukreti / whois.ex

Pure Elixir WHOIS client and parser.
27 stars 16 forks source link

build(deps-dev): bump patch from 0.13.1 to 0.14.0 #35

Closed dependabot[bot] closed 1 month ago

dependabot[bot] commented 1 month ago

Bumps patch from 0.13.1 to 0.14.0.

Changelog

Sourced from patch's changelog.

0.14.0 (2024-10-15)

Changes where mocks are evaluated to prevent misuse and allow for common patterns that were not previously supported.

Pre-0.14.0 mocks would be intercepted by the Patch.Mock.Server and the mock value would be calculated by the server. This works for most cases, but has surprising behavior when the mock function cares about the process executing the function. Consider the following example.

defmodule ExampleTest do
  use ExUnit.Case
  use Patch

test "example" do patch(Example, :get_pid, fn -> self() end)

assert Example.get_pid() == self()

end end

This would fail in pre-0.14.0 because the fn -> self() end would be executed by the Patch.Mock.Server and the pid returned would be the pid for the Patch.Mock.Server and not the caller's pid as the test author might expect.

0.14.0 changes this behavior and now will execute the fn -> self() end in the caller and return the expected result.

This also makes it much more difficult to address the Patch.Mock.Server directly, which is generally discouraged as this server is an implementation detail and should only be addressed by the Patch code itself. This should prevent a class of errors and confusing bugs caused by tests accidentally capturing the pid of, monitoring, or linking to the Patch.Mock.Server

Improvements

  • ⬆️ - [Internal] Mocks are now evaluated in the caller process instead of the Patch.Mock.Server process, see above for details.

Breaking Changes

  • 💔 - Mocks are now evaluated in the caller process instead of the Patch.Mock.Server process. Using the Patch.Mock.Server pid or interacting with the process is not advised but if your tests relied on being able to do this they may break due to this change.
Commits


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 merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show 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)