Use Collectable protocol with an empty map
This commit is contained in:
@@ -25,8 +25,7 @@ defmodule Comprehensions do
|
|||||||
end
|
end
|
||||||
|
|
||||||
koan "Add the result of a comprehension to an existing collection" do
|
koan "Add the result of a comprehension to an existing collection" do
|
||||||
collection = ["Apple Pie"]
|
collection = for x <- ["Pecan", "Pumpkin"], into: %{}, do: {x, "#{x} Pie"}
|
||||||
collection = for x <- ["Pecan", "Pumpkin"], into: collection, do: "#{x} Pie"
|
|
||||||
assert collection == ___
|
assert collection == ___
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user