Remove unneeded function
It's only used in one place, no need for the abstraction currently.
This commit is contained in:
@@ -10,7 +10,10 @@ defmodule Display.Failure do
|
|||||||
"""
|
"""
|
||||||
end
|
end
|
||||||
def format_failure(%{error: %ExUnit.AssertionError{expr: expr}, file: file, line: line}) do
|
def format_failure(%{error: %ExUnit.AssertionError{expr: expr}, file: file, line: line}) do
|
||||||
format_assertion_error(expr, file, line)
|
"""
|
||||||
|
#{Paint.cyan("Assertion failed in #{file}:#{line}")}
|
||||||
|
#{Paint.red(Macro.to_string(expr))}
|
||||||
|
"""
|
||||||
end
|
end
|
||||||
def format_failure(%{error: error, file: file, line: line}) do
|
def format_failure(%{error: error, file: file, line: line}) do
|
||||||
"""
|
"""
|
||||||
@@ -19,13 +22,6 @@ defmodule Display.Failure do
|
|||||||
"""
|
"""
|
||||||
end
|
end
|
||||||
|
|
||||||
defp format_assertion_error(error, file, line) do
|
|
||||||
"""
|
|
||||||
#{Paint.cyan("Assertion failed in #{file}:#{line}")}
|
|
||||||
#{Paint.red(Macro.to_string(error))}
|
|
||||||
"""
|
|
||||||
end
|
|
||||||
|
|
||||||
defp format_error(error) do
|
defp format_error(error) do
|
||||||
trace = System.stacktrace |> Enum.take(2)
|
trace = System.stacktrace |> Enum.take(2)
|
||||||
Paint.red(Exception.format(:error, error, trace))
|
Paint.red(Exception.format(:error, error, trace))
|
||||||
|
|||||||
Reference in New Issue
Block a user