Merge pull request #132 from iamvery/keyword-list-update

Keyword List update
This commit is contained in:
Uku Taht
2016-06-13 23:15:33 +01:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@@ -34,9 +34,14 @@ defmodule KeywordLists do
koan "Conveniently keyword lists can be used for function options" do
transform = fn str, opts ->
if opts[:upcase], do: String.upcase(str)
if opts[:upcase] do
String.upcase(str)
else
str
end
end
assert transform.("good", upcase: true) == ___
assert transform.("good", upcase: false) == ___
end
end

View File

@@ -9,7 +9,7 @@ defmodule KeywordListsTests do
"baz",
{:multiple, [:foo, "bar"]},
"foo",
"GOOD",
{:multiple, ["GOOD", "good"]},
]
test_all(KeywordLists, answers)