update the default case to use a generic message

This commit is contained in:
gemcfadyen
2016-05-27 10:17:21 +01:00
parent e9ab727448
commit 5b2ff206fa
2 changed files with 3 additions and 3 deletions

View File

@@ -6,8 +6,8 @@ defmodule Protocols do
defprotocol School, do: def enrol(person)
defimpl School, for: Any do
def enrol(person) do
"#{person.name} enrolled at school"
def enrol(_) do
"Pupil enrolled at school"
end
end

View File

@@ -5,7 +5,7 @@ defmodule ProtocolsTests do
test "Protocols" do
answers = [
{:multiple, ["Andre signed up for violin", "Darcy enrolled for ballet"]},
"Emily enrolled at school",
"Pupil enrolled at school",
Protocol.UndefinedError
]