Skip to content

Commit 3a36c2e

Browse files
committed
assert_receive(d) should leak
Closes #2030.
1 parent 6448de8 commit 3a36c2e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/ex_unit/lib/ex_unit/assertions.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ defmodule ExUnit.Assertions do
308308

309309
quote do
310310
receive do
311-
unquote(expected) = received -> received
311+
unquote(expected) = received -> unquote(expected) = received
312312
after
313313
unquote(timeout) ->
314314
flunk unquote(message) || "Expected to have received message matching #{unquote binary}"

lib/ex_unit/test/ex_unit/assertions_test.exs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ defmodule ExUnit.AssertionsTest do
8989
end
9090
end
9191

92+
test "assert received leaks" do
93+
send self, { :hello, :world }
94+
assert_received { :hello, world }
95+
:world = world
96+
end
97+
9298
test "refute received does not wait" do
9399
false = refute_received :hello
94100
end

0 commit comments

Comments
 (0)