Merge pull request #86 from Troush/structs-safe-fetch
Map.fetch! -> Map.fetch in 06_structs.ex
This commit is contained in:
@@ -41,6 +41,6 @@ defmodule Structs do
|
|||||||
koan "Struct can be treated like maps" do
|
koan "Struct can be treated like maps" do
|
||||||
silvia = %Person{age: 22, name: "Silvia"}
|
silvia = %Person{age: 22, name: "Silvia"}
|
||||||
|
|
||||||
assert Map.fetch!(silvia, :age) == ___
|
assert Map.fetch(silvia, :age) == ___
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ defmodule StructsTests do
|
|||||||
"Joe",
|
"Joe",
|
||||||
33,
|
33,
|
||||||
{:multiple, [true, false]},
|
{:multiple, [true, false]},
|
||||||
22,
|
{:ok, 22},
|
||||||
]
|
]
|
||||||
|
|
||||||
test_all(Structs, answers)
|
test_all(Structs, answers)
|
||||||
|
|||||||
Reference in New Issue
Block a user