Map.fetch! -> Map.fetch

I think is better to continue use safe ```Map.fetch``` until we familiarize users with dangerous function concept.
Not every body comes from ruby background, with knowledge of ```?``` and ```!``` function notations.

test ifx
This commit is contained in:
Alex
2016-04-26 16:48:09 +03:00
committed by Troush
parent a8784b5349
commit b69010d05c
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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)