Format match? failures more elegantly

[#144]
This commit is contained in:
Jay Hayes
2016-12-23 08:19:30 -06:00
parent 08973f4b54
commit 4bb0b06471
2 changed files with 18 additions and 0 deletions

View File

@@ -26,6 +26,12 @@ defmodule Display.Failure do
defp format_inequality(message, %{left: @no_value, right: @no_value}) do
message
end
defp format_inequality(message, %{left: @no_value, right: match_value}) do
"""
#{message}
value does not match: #{match_value |> inspect |> Paint.yellow}
"""
end
defp format_inequality(message, %{left: left, right: right}) do
"""
#{message}