Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/elixir/lib/kernel/special_forms.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2355,7 +2355,7 @@ defmodule Kernel.SpecialForms do
defmacro try(args), do: error!([args])

@doc """
Checks if there is a message matching any of the given clauses in the current
Consumes the first message matching any of the given clauses in the current
process mailbox.

If there is no matching message, the current process waits until a matching
Expand Down
12 changes: 8 additions & 4 deletions lib/ex_unit/lib/ex_unit/assertions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,10 @@ defmodule ExUnit.Assertions do
The default timeout duration is determined by the `assert_receive_timeout` option,
which can be set using `ExUnit.configure/1`. This option defaults to 100 milliseconds.

The `pattern` argument must be a match pattern. Flunks with `failure_message`
if a message matching `pattern` is not received.
The `pattern` argument must be a match pattern.

Flunks with `failure_message` if a message matching `pattern` is not received.
If a message matches, it is also removed from the process mailbox.

## Examples

Expand All @@ -487,8 +489,10 @@ defmodule ExUnit.Assertions do
Asserts that a message matching `pattern` was received and is in the
current process' mailbox.

The `pattern` argument must be a match pattern. Flunks with `failure_message`
if a message matching `pattern` was not received.
The `pattern` argument must be a match pattern.

Flunks with `failure_message` if a message matching `pattern` was not received.
If a message matches, it is also removed from the process mailbox.

Timeout is set to `0`, so there is no waiting time.

Expand Down