Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump patch from 0.13.1 to 0.14.0 #921

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Oct 16, 2024

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 <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 [patch](https://github.com/ihumanable/patch) from 0.13.1 to 0.14.0.
- [Changelog](https://github.com/ihumanable/patch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ihumanable/patch/commits/v0.14.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file elixir Pull requests that update Elixir code labels Oct 16, 2024
@github-actions github-actions bot enabled auto-merge October 16, 2024 04:17
@github-actions github-actions bot merged commit 77c7358 into main Oct 16, 2024
8 checks passed
@github-actions github-actions bot deleted the dependabot/hex/patch-0.14.0 branch October 16, 2024 04:20
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 elixir Pull requests that update Elixir code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants