Combine Laptop Genserver examples to avoid process leaking issue
This commit is contained in:
@@ -135,15 +135,11 @@ defmodule GenServers do
|
||||
|
||||
koan "Our server works but it's pretty ugly to use; so lets use a cleaner interface" do
|
||||
Laptop.start_link("EL!73")
|
||||
assert Laptop.unlock("EL!73") == ___
|
||||
end
|
||||
|
||||
koan "Let's use the remaining functions in the external API" do
|
||||
Laptop.start_link("EL!73")
|
||||
{_, response} = Laptop.unlock("EL!73")
|
||||
assert response == ___
|
||||
assert Laptop.unlock("EL!73") == ___
|
||||
|
||||
Laptop.change_password("EL!73", "Elixir")
|
||||
|
||||
{_, response} = Laptop.unlock("EL!73")
|
||||
assert response == ___
|
||||
|
||||
|
@@ -11,8 +11,7 @@ defmodule GenServersTests do
|
||||
"73x7!n9",
|
||||
{:error, "Incorrect password!"},
|
||||
"Congrats! Your process was successfully named.",
|
||||
{:ok, "Laptop unlocked!"},
|
||||
{:multiple, ["Laptop unlocked!", "Incorrect password!", "Jack Sparrow"]}
|
||||
{:multiple, [{:ok, "Laptop unlocked!"}, "Incorrect password!", "Jack Sparrow"]}
|
||||
]
|
||||
|
||||
test_all(GenServers, answers)
|
||||
|
Reference in New Issue
Block a user