diff options
author | Martin Kavalar <martin@sauspiel.de> | 2016-02-03 09:59:22 +0100 |
---|---|---|
committer | Martin Kavalar <martin@sauspiel.de> | 2016-02-03 10:30:04 +0100 |
commit | d6415a59296bafae0dad88999dcd9251e91d1385 (patch) | |
tree | bf010a479aad457b2d76821ec6f32167a66c2a38 /lib/elixir/test/elixir/gen_server_test.exs | |
parent | 2b2c66ecf7b1cc2167cae9cc3e88f950994223f1 (diff) | |
download | elixir-d6415a59296bafae0dad88999dcd9251e91d1385.tar.gz |
Make GenServer.cast/2 always return :ok. Closes #4251
This unifies the behavior of `GenServer.cast/2` to always
return :ok and never raise an `ArgumentError`, regardless
of how it is called.
Previously an `ArgumentError` would be be raised only when
called with a nonexistant local process name. In all other cases
which are calling using `:global`, `:via` or `{name, node}`
it would previously always return `:ok`.
The new behavior is now constistant with `:gen_server.cast/2`.
This reverts the change partially introduced in 0d4af57abead1c4dfdc2f71fe198ae539f6eceab.
See #4251 for the full discussion.
Diffstat (limited to 'lib/elixir/test/elixir/gen_server_test.exs')
-rw-r--r-- | lib/elixir/test/elixir/gen_server_test.exs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/elixir/test/elixir/gen_server_test.exs b/lib/elixir/test/elixir/gen_server_test.exs index 7963eb2e3..73273b536 100644 --- a/lib/elixir/test/elixir/gen_server_test.exs +++ b/lib/elixir/test/elixir/gen_server_test.exs @@ -47,9 +47,7 @@ defmodule GenServerTest do assert GenServer.cast({:global, :foo}, {:push, :world}) == :ok assert GenServer.cast({:via, :foo, :bar}, {:push, :world}) == :ok - assert_raise ArgumentError, fn -> - GenServer.cast(:foo, {:push, :world}) - end + assert GenServer.cast(:foo, {:push, :world}) == :ok end test "nil name" do |