diff --git a/lib/koans/05_functions.ex b/lib/koans/05_functions.ex index c791938..e4a3b78 100644 --- a/lib/koans/05_functions.ex +++ b/lib/koans/05_functions.ex @@ -52,7 +52,7 @@ defmodule Functions do end def sum_up(thing) when is_list(thing), do: :entire_list - def sum_up(thing), do: :single_thing + def sum_up(_thing), do: :single_thing koan "You can 'guard' functions against their arguments" do assert sum_up([1,2,3]) == :entire_list assert sum_up(1) == :single_thing diff --git a/lib/koans/07_arithmetic.ex b/lib/koans/07_arithmetic.ex index b7d37d3..f64e164 100644 --- a/lib/koans/07_arithmetic.ex +++ b/lib/koans/07_arithmetic.ex @@ -51,12 +51,4 @@ defmodule Arithmetic do koan "it finds the minimum in a list" do assert Enum.min([1,2,3,4]) == 1 end - - koan "it can not divide by zero" do - try do - 1 / 0.0 - rescue - ArithmeticError -> true - end - end end diff --git a/lib/koans/08_structs.ex b/lib/koans/08_structs.ex index 8e70a12..569e260 100644 --- a/lib/koans/08_structs.ex +++ b/lib/koans/08_structs.ex @@ -6,7 +6,8 @@ defmodule Structs do end koan "structs are defined and named after a module" do - assert %Person{} + person = %Person{} + assert person == %Person{} end koan "you can access the fields of a struct" do @@ -53,7 +54,6 @@ defmodule Structs do koan "are basically maps" do silvia = %Person{age: 22, name: "Silvia"} - assert is_map(silvia) assert Map.fetch!(silvia, :age) == 22 end end