Split koan with race condition into two more logical ones
This commit is contained in:
@@ -17,9 +17,20 @@ defmodule Processes do
|
||||
assert is_pid(self()) == ___
|
||||
end
|
||||
|
||||
koan "New processes are spawned functions" do
|
||||
koan "Like our current process, new processes are spawned functions" do
|
||||
pid = spawn(fn -> nil end)
|
||||
|
||||
assert is_pid(pid) == ___
|
||||
end
|
||||
|
||||
koan "Processes exit after executing their function, unless they wait for something" do
|
||||
wait_forever = fn ->
|
||||
receive do
|
||||
end
|
||||
end
|
||||
|
||||
pid = spawn(wait_forever)
|
||||
|
||||
assert Process.alive?(pid) == ___
|
||||
end
|
||||
|
||||
|
@@ -8,6 +8,7 @@ defmodule ProcessesTests do
|
||||
:running,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
"hola!",
|
||||
{:multiple, ["hola!", "como se llama?"]},
|
||||
:how_are_you?,
|
||||
|
Reference in New Issue
Block a user