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

@@ -25,6 +25,18 @@ defmodule FailureTests do
right: :wat
"""
end
test "match failure" do
error = error(%ExUnit.AssertionError{expr: quote(do: match?(:lol,:wat)), right: :wat})
assert Failure.format_failure(error) == """
Assertion failed in some_file.ex:42
match?(:lol, :wat)
value does not match: :wat
"""
end
defp error(error) do
%{
error: error,