To improve testing, add a layer of indirection around colours.

This commit is contained in:
Felipe Sere
2016-05-14 00:12:42 +02:00
parent 0936ed56e2
commit ddcd971ede
8 changed files with 55 additions and 24 deletions

View File

@@ -1,6 +1,8 @@
defmodule Display.Notifications do
alias Display.Paint
def congratulate do
Colours.green("\nYou have learned much. You must find your own path now.")
Paint.green("\nYou have learned much. You must find your own path now.")
end
def invalid_koan(koan, modules) do
@@ -13,7 +15,7 @@ defmodule Display.Notifications do
|> Enum.map(&Atom.to_string/1)
|> Enum.map(&name/1)
|> Enum.join(", ")
|> Colours.red
|> Paint.red
end
defp name("Elixir." <> module), do: module