Merge pull request #37 from ukutaht/fix_compiler_warnings
Squash compiler warnings.
This commit is contained in:
@@ -52,7 +52,7 @@ defmodule Functions do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def sum_up(thing) when is_list(thing), do: :entire_list
|
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
|
koan "You can 'guard' functions against their arguments" do
|
||||||
assert sum_up([1,2,3]) == :entire_list
|
assert sum_up([1,2,3]) == :entire_list
|
||||||
assert sum_up(1) == :single_thing
|
assert sum_up(1) == :single_thing
|
||||||
|
|||||||
@@ -51,12 +51,4 @@ defmodule Arithmetic do
|
|||||||
koan "it finds the minimum in a list" do
|
koan "it finds the minimum in a list" do
|
||||||
assert Enum.min([1,2,3,4]) == 1
|
assert Enum.min([1,2,3,4]) == 1
|
||||||
end
|
end
|
||||||
|
|
||||||
koan "it can not divide by zero" do
|
|
||||||
try do
|
|
||||||
1 / 0.0
|
|
||||||
rescue
|
|
||||||
ArithmeticError -> true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ defmodule Structs do
|
|||||||
end
|
end
|
||||||
|
|
||||||
koan "structs are defined and named after a module" do
|
koan "structs are defined and named after a module" do
|
||||||
assert %Person{}
|
person = %Person{}
|
||||||
|
assert person == %Person{}
|
||||||
end
|
end
|
||||||
|
|
||||||
koan "you can access the fields of a struct" do
|
koan "you can access the fields of a struct" do
|
||||||
@@ -53,7 +54,6 @@ defmodule Structs do
|
|||||||
koan "are basically maps" do
|
koan "are basically maps" do
|
||||||
silvia = %Person{age: 22, name: "Silvia"}
|
silvia = %Person{age: 22, name: "Silvia"}
|
||||||
|
|
||||||
assert is_map(silvia)
|
|
||||||
assert Map.fetch!(silvia, :age) == 22
|
assert Map.fetch!(silvia, :age) == 22
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user