From b69010d05c618bc9e07f410b2afd018da268b625 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 26 Apr 2016 16:48:09 +0300 Subject: [PATCH] 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 --- lib/koans/06_structs.ex | 2 +- test/koans/structs_koans_test.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/koans/06_structs.ex b/lib/koans/06_structs.ex index d4dba56..230eb21 100644 --- a/lib/koans/06_structs.ex +++ b/lib/koans/06_structs.ex @@ -41,6 +41,6 @@ defmodule Structs do koan "Struct can be treated like maps" do silvia = %Person{age: 22, name: "Silvia"} - assert Map.fetch!(silvia, :age) == ___ + assert Map.fetch(silvia, :age) == ___ end end diff --git a/test/koans/structs_koans_test.exs b/test/koans/structs_koans_test.exs index dbd6031..92622b9 100644 --- a/test/koans/structs_koans_test.exs +++ b/test/koans/structs_koans_test.exs @@ -9,7 +9,7 @@ defmodule StructsTests do "Joe", 33, {:multiple, [true, false]}, - 22, + {:ok, 22}, ] test_all(Structs, answers)