Skip to content

Don't remove behaviour_info/1 from behaviour modules#105

Merged
edgurgel merged 4 commits intoedgurgel:mainfrom
escobera:fix/add-callbacks-to-mimic-module
Sep 20, 2025
Merged

Don't remove behaviour_info/1 from behaviour modules#105
edgurgel merged 4 commits intoedgurgel:mainfrom
escobera:fix/add-callbacks-to-mimic-module

Conversation

@escobera
Copy link
Contributor

@escobera escobera commented Sep 5, 2025

After #104 was merged I started getting the following errors on my tests

** (UndefinedFunctionError) function MyModule.behaviour_info/1 is undefined or private

The reason is that that, behaviour_info it is only added when there is a @callback in the module and it doesn't show up in module.__info__(:functions).

This PR adds a step create_mock function to somewhat recreate the callbacks present in the original module. I had to use any() for types in the callbacks because the only way to get the original types involved using Code.Typespec which is a private api.

@escobera escobera changed the title Generate callbacks for the mimic'd module Generate callbacks for the mimicked module Sep 5, 2025
@escobera escobera marked this pull request as draft September 6, 2025 01:42
@escobera escobera marked this pull request as ready for review September 6, 2025 02:14
@edgurgel
Copy link
Owner

edgurgel commented Sep 9, 2025

Thanks! I'm still unsure how the previous change cause this issue.

@escobera
Copy link
Contributor Author

escobera commented Sep 12, 2025

So this is how I understand it:

When a module has a @callback, the elixir compiler will generate the behavior_info/1 function.

This function doesn't appear on Module.__info__(:functions), but it appears on Module.module_info(:exports). You can try this out in Iex with the following code:

defmodule Example do
  @callback test() :: :ok
end

Example.__info__(:functions)
# []
Example.module_info(:exports)
# [__info__: 1, behaviour_info: 1, module_info: 0, module_info: 1]

Before #104 the generate_mimic_functions/1 used module.module_info(:exports) to get the original module functions, this caused the side effect of adding back the behaviour_info/1 function to the list of functions in case of behaviour modules.

This change in #104

-    for {fn_name, arity} <- module.module_info(:exports),
+    for {fn_name, arity} <- if function_exported?(module, :__info__, 1) do
+      module.__info__(:functions)
+    else
+      module.module_info(:exports)
+    end,

filtered the behaviour_info/1.

I went a different route (as not to revert part of #104). And added back any @callbacks to the mock module, so the elixir compiler will auto-generate the behaviour_info/1 function and not depend on the generate_mimic_functions/1.

@edgurgel
Copy link
Owner

Hmmm I'm more tempted in returning to using exports but excluding macro functions from being copied. Something like this:

  defp generate_mimic_functions(module) do
    internal_functions = [__info__: 1, module_info: 0, module_info: 1]
    macro_functions = macro_functions(module)
    functions = module.module_info(:exports)

    for {fn_name, arity} <- functions,
        {fn_name, arity} not in (internal_functions ++ macro_functions) do # Exclude macro as functions
    ...
  end

  defp macro_functions(module) do
    if function_exported?(module, :__info__, 1) do
      :macros
      |> module.__info__()
      |> Enum.map(fn {name, arity} -> {String.to_atom("MACRO-#{name}"), arity + 1} end)
    else
      []
    end
  end

WDYT?

Could you check if this would work with your tests?

@escobera
Copy link
Contributor Author

I checked and it works! I've also changed the test I've added to act as a regression test for this behavior.

@edgurgel
Copy link
Owner

Great! Thanks once again 🎉

@escobera escobera changed the title Generate callbacks for the mimicked module Don't remove behaviour_info/1 from behaviour modules Sep 16, 2025
@escobera
Copy link
Contributor Author

Changed the PR name to better match the solution.

@edgurgel edgurgel merged commit 5aa97ce into edgurgel:main Sep 20, 2025
4 checks passed
jimsynz pushed a commit to jimsynz/wayfarer that referenced this pull request Oct 13, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | prod | major | `~> 1.12` -> `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)
```

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4zMi4wIiwidXBkYXRlZEluVmVyIjoiNDEuMTI0LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbInJlbm92YXRlIl19-->

Reviewed-on: https://harton.dev/james/wayfarer/pulls/280
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
jimsynz pushed a commit to jimsynz/wafer that referenced this pull request Oct 13, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | dev | major | `~> 1.12` -> `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)
```

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4zMi4wIiwidXBkYXRlZEluVmVyIjoiNDEuMTI0LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbInJlbm92YXRlIl19-->

Reviewed-on: https://harton.dev/james/wafer/pulls/148
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
jimsynz pushed a commit to jimsynz/pca9641 that referenced this pull request Oct 13, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | dev | major | `~> 1.12` -> `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)
```

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4zOC4xIiwidXBkYXRlZEluVmVyIjoiNDEuMTI0LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbInJlbm92YXRlIl19-->

Reviewed-on: https://harton.dev/james/pca9641/pulls/109
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
jimsynz pushed a commit to jimsynz/mpl311512 that referenced this pull request Oct 13, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | dev | major | `~> 1.12` -> `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)
```

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4zMi4wIiwidXBkYXRlZEluVmVyIjoiNDEuMTI0LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbInJlbm92YXRlIl19-->

Reviewed-on: https://harton.dev/james/mpl3115a2/pulls/104
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
jimsynz pushed a commit to jimsynz/max1704x that referenced this pull request Oct 13, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | dev | major | `~> 1.12` -> `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)
```

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4zMi4wIiwidXBkYXRlZEluVmVyIjoiNDEuMTI0LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbInJlbm92YXRlIl19-->

Reviewed-on: https://harton.dev/james/max1704x/pulls/136
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
jimsynz pushed a commit to jimsynz/lamina that referenced this pull request Oct 13, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | prod | major | `~> 1.12` -> `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)
```

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4zMi4wIiwidXBkYXRlZEluVmVyIjoiNDEuMTI0LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbInJlbm92YXRlIl19-->

Reviewed-on: https://harton.dev/james/lamina/pulls/108
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
jimsynz pushed a commit to jimsynz/ina219 that referenced this pull request Oct 13, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | dev | major | `~> 1.12` -> `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)
```

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4zMi4wIiwidXBkYXRlZEluVmVyIjoiNDEuMTI0LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbInJlbm92YXRlIl19-->

Reviewed-on: https://harton.dev/james/ina219/pulls/107
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
jimsynz pushed a commit to jimsynz/wayfarer that referenced this pull request Oct 22, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | prod | major | `~> 1.12` -> `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)
```

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDYuNSIsInVwZGF0ZWRJblZlciI6IjQxLjE1Ni4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://harton.dev/james/wayfarer/pulls/286
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
jimsynz pushed a commit to jimsynz/wafer that referenced this pull request Oct 24, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | dev | major | `~> 1.12` -> `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)
```

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTYuMiIsInVwZGF0ZWRJblZlciI6IjQxLjE1Ni4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://harton.dev/james/wafer/pulls/156
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
jimsynz pushed a commit to jimsynz/mpl311512 that referenced this pull request Oct 24, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | dev | major | `~> 1.12` -> `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)
```

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTYuMiIsInVwZGF0ZWRJblZlciI6IjQxLjE1Ni4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://harton.dev/james/mpl3115a2/pulls/112
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
jimsynz pushed a commit to jimsynz/max1704x that referenced this pull request Oct 24, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | dev | major | `~> 1.12` -> `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)
```

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTYuMiIsInVwZGF0ZWRJblZlciI6IjQxLjE1Ni4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://harton.dev/james/max1704x/pulls/144
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
jimsynz pushed a commit to jimsynz/lamina that referenced this pull request Oct 24, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | prod | major | `~> 1.12` -> `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)
```

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTYuMiIsInVwZGF0ZWRJblZlciI6IjQxLjE1Ni4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://harton.dev/james/lamina/pulls/117
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
jimsynz pushed a commit to jimsynz/ina219 that referenced this pull request Oct 24, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | dev | major | `~> 1.12` -> `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)
```

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTYuMiIsInVwZGF0ZWRJblZlciI6IjQxLjE1Ni4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://harton.dev/james/ina219/pulls/115
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
jimsynz pushed a commit to jimsynz/pca9641 that referenced this pull request Jan 22, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mimic](https://hex.pm/packages/mimic) ([source](https://github.com/edgurgel/mimic)) | dev | major | `~> 1.12` → `~> 2.0` |

---

### Release Notes

<details>
<summary>edgurgel/mimic (mimic)</summary>

### [`v2.3.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#230-2026-01-17)

[Compare Source](edgurgel/mimic@v2.2.0...v2.3.0)

- fix: namespace auto setup verify\_on\_exit! by [@&#8203;PragTob](https://github.com/PragTob) in [#&#8203;111](edgurgel/mimic#111)
- feat: prevent global mode in async tests by [@&#8203;rbino](https://github.com/rbino) in [#&#8203;110](edgurgel/mimic#110)

### [`v2.2.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#220-2025-11-18)

[Compare Source](edgurgel/mimic@v2.1.1...v2.2.0)

- Add elixir 1.19.x compatibility by [@&#8203;Geekfish](https://github.com/Geekfish) in [#&#8203;107](edgurgel/mimic#107)

### [`v2.1.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#211-2025-09-20)

[Compare Source](edgurgel/mimic@v2.1.0...v2.1.1)

- Don't remove behaviour\_info/1 from behaviour modules by [@&#8203;escobera](https://github.com/escobera) in [#&#8203;105](edgurgel/mimic#105)

### [`v2.1.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#210-2025-08-31)

[Compare Source](edgurgel/mimic@v2.0.2...v2.1.0)

- feat: Usage rules by [@&#8203;pcharbon70](https://github.com/pcharbon70) in [#&#8203;102](edgurgel/mimic#102)
- fix: define replaced Elixir module macros using defmacro by [@&#8203;yastanotheruser](https://github.com/yastanotheruser) in [#&#8203;104](edgurgel/mimic#104)

### [`v2.0.2`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#202-2025-08-12)

[Compare Source](edgurgel/mimic@v2.0.1...v2.0.2)

- fix: Mimic.Module compilation when no options are stored. [#&#8203;101](edgurgel/mimic#101)

### [`v2.0.1`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#201-2025-08-08)

[Compare Source](edgurgel/mimic@v2.0.0...v2.0.1)

- Bump `ham` requirement

### [`v2.0.0`](https://github.com/edgurgel/mimic/blob/HEAD/CHANGELOG.md#200-2025-07-13)

[Compare Source](edgurgel/mimic@v1.12.0...v2.0.0)

#### Breaking changes

The code below would call the original `Calculator.add/2` when all expectations were fulfilled.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

Now with Mimic 2 this will raise:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)

# Will raise error because more than 2 calls to Calculator.add were made and there is no stub
# ** (Mimic.UnexpectedCallError) Calculator.add/2 called in process #PID<.*> but expectations are already fulfilled
```

If there is a stub the stub will be called instead. This behaviour is the same as before.

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)
 |> stub(:add, fn _, _ -> :stub end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == :stub
```

Which means that if someone wants to keep the original behaviour on Mimic 1.\* just do the following:

```elixir
 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)
 |> stub(:add, fn x, y -> call_original(Calculator, :add, [x, y]) end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2
```

This way once all expectations are fulfilled the original function is called again.

### [`v1.12.0`](https://github.com/edgurgel/mimic/releases/tag/v1.12.0): Mimic 1.12.0

[Compare Source](edgurgel/mimic@v1.11.2...v1.12.0)

#### What's Changed

- Mimic.calls/3 to list args from each call by [@&#8203;brentjanderson](https://github.com/brentjanderson) in [#&#8203;94](edgurgel/mimic#94)

#### New Contributors

- [@&#8203;brentjanderson](https://github.com/brentjanderson) made their first contribution in [#&#8203;94](edgurgel/mimic#94)

**Full Changelog**: <edgurgel/mimic@v1.11.2...v1.12.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland, Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone Pacific/Auckland.

🚦 **Automerge**: Disabled because a matching PR was automerged previously.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [x] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTYuMiIsInVwZGF0ZWRJblZlciI6IjQyLjg3LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbInJlbm92YXRlIl19-->

Reviewed-on: https://harton.dev/james/pca9641/pulls/116
Co-authored-by: Renovate Bot <bot@harton.nz>
Co-committed-by: Renovate Bot <bot@harton.nz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants