Skip to content

Commit

Permalink
Bump patch from 0.13.1 to 0.14.0 (#921)
Browse files Browse the repository at this point in the history
Bumps [patch](https://github.com/ihumanable/patch) from 0.13.1 to
0.14.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ihumanable/patch/blob/master/CHANGELOG.md">patch's
changelog</a>.</em></p>
<blockquote>
<h2>0.14.0 (2024-10-15)</h2>
<p>Changes where mocks are evaluated to prevent misuse and allow for
common patterns that were not previously supported.</p>
<p>Pre-0.14.0 mocks would be intercepted by the
<code>Patch.Mock.Server</code> 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.</p>
<pre lang="elixir"><code>defmodule ExampleTest do
  use ExUnit.Case
  use Patch
<p>test &quot;example&quot; do
patch(Example, :get_pid, fn -&gt; self() end)</p>
<pre><code>assert Example.get_pid() == self()
</code></pre>
<p>end
end
</code></pre></p>
<p>This would fail in pre-0.14.0 because the <code>fn -&gt; self()
end</code> would be executed by the <code>Patch.Mock.Server</code> and
the pid returned would be the pid for the <code>Patch.Mock.Server</code>
and not the caller's pid as the test author might expect.</p>
<p>0.14.0 changes this behavior and now will execute the <code>fn -&gt;
self() end</code> in the caller and return the expected result.</p>
<p>This also makes it much more difficult to address the
<code>Patch.Mock.Server</code> 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 <code>Patch.Mock.Server</code></p>
<h3>Improvements</h3>
<ul>
<li>⬆️ - [Internal] Mocks are now evaluated in the caller process
instead of the <code>Patch.Mock.Server</code> process, see above for
details.</li>
</ul>
<h3>Breaking Changes</h3>
<ul>
<li>💔 - Mocks are now evaluated in the caller process instead of the
<code>Patch.Mock.Server</code> process. Using the
<code>Patch.Mock.Server</code> 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.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/ihumanable/patch/commits/v0.14.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=patch&package-manager=hex&previous-version=0.13.1&new-version=0.14.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

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)


</details>
  • Loading branch information
github-actions[bot] authored Oct 16, 2024
2 parents 395d0b7 + 503113c commit 77c7358
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"number": {:hex, :number, "1.0.5", "d92136f9b9382aeb50145782f116112078b3465b7be58df1f85952b8bb399b0f", [:mix], [{:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "c0733a0a90773a66582b9e92a3f01290987f395c972cb7d685f51dd927cd5169"},
"oban": {:hex, :oban, "2.18.3", "1608c04f8856c108555c379f2f56bc0759149d35fa9d3b825cb8a6769f8ae926", [:mix], [{:ecto_sql, "~> 3.10", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "36ca6ca84ef6518f9c2c759ea88efd438a3c81d667ba23b02b062a0aa785475e"},
"owl": {:hex, :owl, "0.12.0", "0c4b48f90797a7f5f09ebd67ba7ebdc20761c3ec9c7928dfcafcb6d3c2d25c99", [:mix], [{:ucwidth, "~> 0.2", [hex: :ucwidth, repo: "hexpm", optional: true]}], "hexpm", "241d85ae62824dd72f9b2e4a5ba4e69ebb9960089a3c68ce6c1ddf2073db3c15"},
"patch": {:hex, :patch, "0.13.1", "2da5b508e4d6558924a0959d95dc3aa8176b5ccf2539e4567481448d61853ccc", [:mix], [], "hexpm", "75f805827d9db0c335155fbb857e6eeb5c85034c9dc668d146bc0bfe48fac822"},
"patch": {:hex, :patch, "0.14.0", "34820b7790fbb76d3214e35cb6548210bda00ed1a224b36bb3195daa4a71dd68", [:mix], [], "hexpm", "8d0592a40d64791c36fcbc7dbe368d0436ec166b9561b2fa6358cb2bab17cfa6"},
"phoenix": {:hex, :phoenix, "1.7.14", "a7d0b3f1bc95987044ddada111e77bd7f75646a08518942c72a8440278ae7825", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "c7859bc56cc5dfef19ecfc240775dae358cbaa530231118a9e014df392ace61a"},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.6.2", "3b83b24ab5a2eb071a20372f740d7118767c272db386831b2e77638c4dcc606d", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.1", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}], "hexpm", "3f94d025f59de86be00f5f8c5dd7b5965a3298458d21ab1c328488be3b5fcd59"},
"phoenix_html": {:hex, :phoenix_html, "4.1.1", "4c064fd3873d12ebb1388425a8f2a19348cef56e7289e1998e2d2fa758aa982e", [:mix], [], "hexpm", "f2f2df5a72bc9a2f510b21497fd7d2b86d932ec0598f0210fed4114adc546c6f"},
Expand Down

0 comments on commit 77c7358

Please sign in to comment.