Skip to content

Commit 11601a6

Browse files
committed
Split genserver koans back up
1 parent 090187c commit 11601a6

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lib/koans/18_genservers.ex

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,15 @@ defmodule GenServers do
134134
end
135135

136136
koan "Our server works but it's pretty ugly to use; so lets use a cleaner interface" do
137-
Laptop.start_link("EL!73")
138-
137+
Laptop.start("EL!73")
139138
assert Laptop.unlock("EL!73") == ___
139+
end
140+
141+
koan "Let's use the remaining functions in the external API" do
142+
Laptop.start("EL!73")
143+
144+
{_, response} = Laptop.unlock("EL!73")
145+
assert response == ___
140146

141147
Laptop.change_password("EL!73", "Elixir")
142148

test/koans/genservers_koans_test.exs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ defmodule GenServersTests do
1111
"73x7!n9",
1212
{:error, "Incorrect password!"},
1313
"Congrats! Your process was successfully named.",
14-
{:multiple, [{:ok, "Laptop unlocked!"}, "Incorrect password!", "Jack Sparrow"]}
14+
{:ok, "Laptop unlocked!"},
15+
{:multiple, ["Laptop unlocked!", "Incorrect password!", "Jack Sparrow"]}
1516
]
1617

1718
test_all(GenServers, answers)

0 commit comments

Comments
 (0)