Skip to content

Commit 5abaad3

Browse files
build(deps-dev): bump mimic from 1.12.0 to 2.0.0 (#133)
Bumps [mimic](https://github.com/edgurgel/mimic) from 1.12.0 to 2.0.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/edgurgel/mimic/releases">mimic's releases</a>.</em></p> <blockquote> <h2>Mimic 2.0.0</h2> <h2>What's Changed</h2> <ul> <li>feat!: change expect/3,4 to not call original once fulfilled by <a href="https://github.com/edgurgel"><code>@​edgurgel</code></a> in <a href="https://redirect.github.com/edgurgel/mimic/pull/98">edgurgel/mimic#98</a></li> </ul> <h2>Breaking changes</h2> <p>The code below would call the original <code>Calculator.add/2</code> when all expectations were fulfilled.</p> <pre lang="elixir"><code> Calculator |&gt; expect(:add, fn _, _ -&gt; :expected1 end) |&gt; expect(:add, fn _, _ -&gt; :expected2 end) <p>assert Calculator.add(1, 1) == :expected1 assert Calculator.add(1, 1) == :expected2 assert Calculator.add(1, 1) == 2 </code></pre></p> <p>Now with Mimic 2 this will raise:</p> <pre lang="elixir"><code> Calculator |&gt; expect(:add, fn _, _ -&gt; :expected1 end) |&gt; expect(:add, fn _, _ -&gt; :expected2 end) <p>assert Calculator.add(1, 1) == :expected1 assert Calculator.add(1, 1) == :expected2 Calculator.add(1, 1)</p> <h1>Will raise error because more than 2 calls to Calculator.add were made and there is no stub</h1> <h1>** (Mimic.UnexpectedCallError) Calculator.add/2 called in process #PID&lt;.*&gt; but expectations are already fulfilled</h1> <p></code></pre></p> <p>If there is a stub the stub will be called instead. This behaviour is the same as before.</p> <pre lang="elixir"><code> Calculator |&gt; expect(:add, fn _, _ -&gt; :expected1 end) |&gt; expect(:add, fn _, _ -&gt; :expected2 end) |&gt; stub(:add, fn _, _ -&gt; :stub end) <p>assert Calculator.add(1, 1) == :expected1 assert Calculator.add(1, 1) == :expected2 assert Calculator.add(1, 1) == :stub </code></pre></p> <p>Which means that if someone wants to keep the original behaviour on Mimic 1.* just do the following:</p> <pre lang="elixir"><code> Calculator |&gt; expect(:add, fn _, _ -&gt; :expected1 end) &lt;/tr&gt;&lt;/table&gt; </code></pre> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/edgurgel/mimic/blob/main/CHANGELOG.md">mimic's changelog</a>.</em></p> <blockquote> <h1>2.0.0 (2025-07-13)</h1> <h2>Breaking changes</h2> <p>The code below would call the original <code>Calculator.add/2</code> when all expectations were fulfilled.</p> <pre lang="elixir"><code> Calculator |&gt; expect(:add, fn _, _ -&gt; :expected1 end) |&gt; expect(:add, fn _, _ -&gt; :expected2 end) <p>assert Calculator.add(1, 1) == :expected1 assert Calculator.add(1, 1) == :expected2 assert Calculator.add(1, 1) == 2 </code></pre></p> <p>Now with Mimic 2 this will raise:</p> <pre lang="elixir"><code> Calculator |&gt; expect(:add, fn _, _ -&gt; :expected1 end) |&gt; expect(:add, fn _, _ -&gt; :expected2 end) <p>assert Calculator.add(1, 1) == :expected1 assert Calculator.add(1, 1) == :expected2 Calculator.add(1, 1)</p> <h1>Will raise error because more than 2 calls to Calculator.add were made and there is no stub</h1> <h1>** (Mimic.UnexpectedCallError) Calculator.add/2 called in process #PID&lt;.*&gt; but expectations are already fulfilled</h1> <p></code></pre></p> <p>If there is a stub the stub will be called instead. This behaviour is the same as before.</p> <pre lang="elixir"><code> Calculator |&gt; expect(:add, fn _, _ -&gt; :expected1 end) |&gt; expect(:add, fn _, _ -&gt; :expected2 end) |&gt; stub(:add, fn _, _ -&gt; :stub end) <p>assert Calculator.add(1, 1) == :expected1 assert Calculator.add(1, 1) == :expected2 assert Calculator.add(1, 1) == :stub </code></pre></p> <p>Which means that if someone wants to keep the original behaviour on Mimic 1.* just do the following:</p> <pre lang="elixir"><code> Calculator |&gt; expect(:add, fn _, _ -&gt; :expected1 end) |&gt; expect(:add, fn _, _ -&gt; :expected2 end) |&gt; stub(:add, fn x, y -&gt; call_original(Calculator, :add, [x, y]) end) &lt;/tr&gt;&lt;/table&gt; </code></pre> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/edgurgel/mimic/commit/fee266247b642b0f117e3aafbf0b7c4a0eb50e0a"><code>fee2662</code></a> feat!: change expect/3,4 to not call original once fulfilled (<a href="https://redirect.github.com/edgurgel/mimic/issues/98">#98</a>)</li> <li>See full diff in <a href="https://github.com/edgurgel/mimic/compare/v1.12.0...v2.0.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mimic&package-manager=hex&previous-version=1.12.0&new-version=2.0.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> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 752a031 commit 5abaad3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ defmodule JetPluginSDK.MixProject do
3838
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
3939
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
4040
{:ex_doc, "~> 0.31", only: :dev, runtime: false},
41-
{:mimic, "~> 1.7", only: :test},
41+
{:mimic, "~> 2.0", only: :test},
4242
{:jet_ext, "~> 0.3.0"}
4343
]
4444
end

mix.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"},
2121
"makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"},
2222
"mime": {:hex, :mime, "2.0.7", "b8d739037be7cd402aee1ba0306edfdef982687ee7e9859bee6198c1e7e2f128", [:mix], [], "hexpm", "6171188e399ee16023ffc5b76ce445eb6d9672e2e241d2df6050f3c771e80ccd"},
23-
"mimic": {:hex, :mimic, "1.12.0", "34c9d1fb8e756df09ca5f96861d273f2bb01063df1a6a51a4c101f9ad7f07a9c", [:mix], [{:ham, "~> 0.2", [hex: :ham, repo: "hexpm", optional: false]}], "hexpm", "eaa43d495d6f3bc8099b28886e05a1b09a2a6be083f6385c3abc17599e5e2c43"},
23+
"mimic": {:hex, :mimic, "2.0.0", "2fb235e54dee19a71244c22b234dbf29f407f01352943f4d9f2ed1c0933d53d3", [:mix], [{:ham, "~> 0.2", [hex: :ham, repo: "hexpm", optional: false]}], "hexpm", "1d518ae1f46316c72cc0eacb1b73e1371a6965a79e3733d4ccb7349cb2a9025a"},
2424
"mint": {:hex, :mint, "1.7.1", "113fdb2b2f3b59e47c7955971854641c61f378549d73e829e1768de90fc1abf1", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0 or ~> 1.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "fceba0a4d0f24301ddee3024ae116df1c3f4bb7a563a731f45fdfeb9d39a231b"},
2525
"nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"},
2626
"nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"},

0 commit comments

Comments
 (0)