From 4017cfcd72e9ad0bb25cace916b9bb26258f00d5 Mon Sep 17 00:00:00 2001 From: Jay Hayes Date: Tue, 3 May 2016 19:21:51 -0500 Subject: [PATCH 1/2] Change test data to illustrate that they /all/ must match --- lib/koans/09_enums.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/koans/09_enums.ex b/lib/koans/09_enums.ex index 474dd46..ad17fb7 100644 --- a/lib/koans/09_enums.ex +++ b/lib/koans/09_enums.ex @@ -12,7 +12,7 @@ defmodule Enums do def less_than_five?(n), do: n < 5 koan "Elements can have a lot in common" do assert Enum.all?([1 ,2 ,3], &less_than_five?/1) == ___ - assert Enum.all?([6 ,7 ,8 ,9], &less_than_five?/1) == ___ + assert Enum.all?([4, 6 ,8], &less_than_five?/1) == ___ end def even?(n), do: rem(n, 2) == 0 From 19998b452c803721c58c98a435df76eea49f5872 Mon Sep 17 00:00:00 2001 From: Jay Hayes Date: Tue, 3 May 2016 19:22:16 -0500 Subject: [PATCH 2/2] Add another match to illustrate that only the first is found --- lib/koans/09_enums.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/koans/09_enums.ex b/lib/koans/09_enums.ex index ad17fb7..adb9726 100644 --- a/lib/koans/09_enums.ex +++ b/lib/koans/09_enums.ex @@ -61,7 +61,7 @@ defmodule Enums do end koan "When you want to find that one pesky element" do - assert Enum.find([1 ,2 ,3], &even?/1) == ___ + assert Enum.find([1 ,2 ,3, 4], &even?/1) == ___ end def divisible_by_five?(n), do: rem(n, 5) == 0