subscriptions |> Enum.map(fn x -> Map.get(x, :tfl_lines) end) |> List.flatten() |> Enum.join(", ") if String.length(lines) > 0 do "You are currently subscribed to: #{lines}" else "You are currently not subscribed to any line" end end 19
-> Map.get(x, :tfl_lines) end) |> List.flatten() |> Enum.join(", ") |> subscriptions_message_text() end # Horizontal functions defp subscriptions_message_text(""), do: "You are currently not subscribed to any line" defp subscriptions_message_text(lines), do: "You are currently subscribed to: #{lines}" 20
s, expected) do assert v == expected s end test "complex hashing works!" do %SomeStruct{value: "javier"} |> capitalize() |> assert_result("Javier") |> hash() |> assert_result("7F3D0970EC0E336AA08A9E14D4D88E79131E0065") |> downcase() |> assert_result("7f3d0970ec0e336aa08a9e14d4d88e79131e0065") end 27