Merge pull request #188 from trumant/spelling_and_grammar

Correcting some spelling and grammar issues
This commit is contained in:
Uku Taht
2017-04-22 20:13:11 +01:00
committed by GitHub
2 changed files with 9 additions and 9 deletions

View File

@@ -157,7 +157,7 @@ defmodule Processes do
assert_receive {:EXIT, _pid, ___}
end
koan "If you monitor your children, you'll be automatically informed for their depature" do
koan "If you monitor your children, you'll be automatically informed of their departure" do
spawn_monitor(fn -> Process.exit(self(), :normal) end)
assert_receive {:DOWN, _ref, :process, _pid, ___}

View File

@@ -3,10 +3,10 @@ defmodule Protocols do
@intro "Want to follow the rules? Adhere to the protocol!"
defprotocol School, do: def enrol(person)
defprotocol School, do: def enroll(person)
defimpl School, for: Any do
def enrol(_) do
def enroll(_) do
"Pupil enrolled at school"
end
end
@@ -21,31 +21,31 @@ defmodule Protocols do
defmodule Baker, do: defstruct name: ""
defimpl School, for: Musician do
def enrol(musician) do
def enroll(musician) do
"#{musician.name} signed up for #{musician.instrument}"
end
end
defimpl School, for: Dancer do
def enrol(dancer), do: "#{dancer.name} enrolled for #{dancer.dance_style}"
def enroll(dancer), do: "#{dancer.name} enrolled for #{dancer.dance_style}"
end
koan "Sharing an interface is the secret at school" do
musician = %Musician{name: "Andre", instrument: "violin"}
dancer = %Dancer{name: "Darcy", dance_style: "ballet"}
assert School.enrol(musician) == ___
assert School.enrol(dancer) == ___
assert School.enroll(musician) == ___
assert School.enroll(dancer) == ___
end
koan "Sometimes we all use the same" do
student = %Student{name: "Emily"}
assert School.enrol(student) == ___
assert School.enroll(student) == ___
end
koan "If you don't comply you can't get in" do
assert_raise ___, fn ->
School.enrol(%Baker{name: "Delia"})
School.enroll(%Baker{name: "Delia"})
end
end
end