diff --git a/lib/koans/07_keyword_lists.ex b/lib/koans/07_keyword_lists.ex index 97680ae..31ef9b9 100644 --- a/lib/koans/07_keyword_lists.ex +++ b/lib/koans/07_keyword_lists.ex @@ -31,17 +31,4 @@ defmodule KeywordLists do assert_raise ArgumentError, fn -> not_kw_list[___] end end - - koan "Conveniently keyword lists can be used for function options" do - transform = fn str, opts -> - if opts[:upcase] do - String.upcase(str) - else - str - end - end - - assert transform.("good", upcase: true) == ___ - assert transform.("good", upcase: false) == ___ - end end diff --git a/lib/koans/13_functions.ex b/lib/koans/13_functions.ex index e362d1d..eb349de 100644 --- a/lib/koans/13_functions.ex +++ b/lib/koans/13_functions.ex @@ -97,4 +97,17 @@ defmodule Functions do assert result == ___ end + + koan "Conveniently keyword lists can be used for function options" do + transform = fn str, opts -> + if opts[:upcase] do + String.upcase(str) + else + str + end + end + + assert transform.("good", upcase: true) == ___ + assert transform.("good", upcase: false) == ___ + end end diff --git a/test/koans/functions_koans_test.exs b/test/koans/functions_koans_test.exs index 088d3df..20cb286 100644 --- a/test/koans/functions_koans_test.exs +++ b/test/koans/functions_koans_test.exs @@ -18,6 +18,7 @@ defmodule FunctionsTests do 100, 1000, "Full Name", + {:multiple, ["GOOD", "good"]}, ] test_all(Functions, answers) diff --git a/test/koans/keyword_lists_koans_test.exs b/test/koans/keyword_lists_koans_test.exs index bdff15d..dee5dc5 100644 --- a/test/koans/keyword_lists_koans_test.exs +++ b/test/koans/keyword_lists_koans_test.exs @@ -9,7 +9,6 @@ defmodule KeywordListsTests do "baz", {:multiple, [:foo, "bar"]}, "foo", - {:multiple, ["GOOD", "good"]}, ] test_all(KeywordLists, answers)