Skip to content

Commit ccf1add

Browse files
committed
Release v1.1.0
1 parent 43f4de1 commit ccf1add

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## v1.1.0 (2023-09-20)
4+
5+
### Enhancements
6+
7+
* Support testing in a cluster
8+
* Support a function to retrieve the PID to allow in `Mox.allow/3`
9+
310
## v1.0.2 (2022-05-30)
411

512
### Bug fix

lib/mox.ex

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ defmodule Mox do
189189
when the allowance happens. In such a case, you might specify the allowance
190190
as a function in the form `(-> pid())`. This function would be resolved late,
191191
at the very moment of dispatch. If the function does not return an existing
192-
PID, it will fail `Mox.UnexpectedCallError`.
192+
PID, Mox will raise a `Mox.UnexpectedCallError` exception.
193193
194194
### Global mode
195195
@@ -684,6 +684,7 @@ defmodule Mox do
684684
during invocation, the expectation will not succeed.
685685
686686
allow(MyMock, self(), fn -> GenServer.whereis(Deferred) end)
687+
687688
"""
688689
@spec allow(mock, pid(), term()) :: mock when mock: t()
689690
def allow(mock, owner_pid, allowed_via) when is_atom(mock) and is_pid(owner_pid) do
@@ -827,13 +828,13 @@ defmodule Mox do
827828
"called #{times(count + 1)} in #{format_process()}"
828829

829830
{:remote, fun_to_call} ->
830-
# it's possible that Mox.Server is running on a remote node in the cluster. Since the lambda
831-
# that we passed is not guaranteed to exist on this node (it might have come from a .exs file)
832-
# find the remote node that hosts Mox.Server, and run the lambda on that node.
833-
831+
# It's possible that Mox.Server is running on a remote node in the cluster. Since the
832+
# function that we passed is not guaranteed to exist on that node (it might have come
833+
# from a .exs file), find the remote node that hosts Mox.Server, and run the function
834+
# on that node.
834835
Mox.Server
835836
|> :global.whereis_name()
836-
|> node
837+
|> node()
837838
|> :rpc.call(Kernel, :apply, [fun_to_call, args])
838839

839840
{:ok, fun_to_call} ->

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Mox.MixProject do
22
use Mix.Project
33

4-
@version "1.0.2"
4+
@version "1.1.0"
55

66
def project do
77
[

0 commit comments

Comments
 (0)