Add new test illustrating spawning processes

This commit is contained in:
Jay Hayes
2016-05-02 18:49:40 -05:00
parent 3892c0477e
commit bef1cf5028
2 changed files with 7 additions and 0 deletions

View File

@@ -11,6 +11,12 @@ defmodule Processes do
assert information[:status] == ___ assert information[:status] == ___
end end
koan "New processes are spawned" do
pid = spawn(fn -> nil end)
assert Process.alive?(pid) == ___
end
koan "You can send messages to any process you want" do koan "You can send messages to any process you want" do
send self(), "hola!" send self(), "hola!"
assert_receive ___ assert_receive ___

View File

@@ -6,6 +6,7 @@ defmodule ProcessesTests do
answers = [ answers = [
true, true,
:running, :running,
true,
"hola!", "hola!",
:how_are_you?, :how_are_you?,
{:waited_too_long, "I am inpatient"}, {:waited_too_long, "I am inpatient"},