diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2017-05-26 10:26:37 +0200 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2017-05-26 10:26:37 +0200 |
commit | 70b6f973c0631877c98de696330c1649ed35dcd0 (patch) | |
tree | 2922e4db13d829e3b479fe3b79cb3fcf7962bbf3 | |
parent | 0d14e724d424cb1b3edcd443d3881f2d1b309b24 (diff) | |
download | elixir-70b6f973c0631877c98de696330c1649ed35dcd0.tar.gz |
Do not add multiple lines to blame report on ExUnit
-rw-r--r-- | lib/ex_unit/lib/ex_unit/formatter.ex | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/ex_unit/lib/ex_unit/formatter.ex b/lib/ex_unit/lib/ex_unit/formatter.ex index fefab3b48..d89077d90 100644 --- a/lib/ex_unit/lib/ex_unit/formatter.ex +++ b/lib/ex_unit/lib/ex_unit/formatter.ex @@ -167,11 +167,9 @@ defmodule ExUnit.Formatter do defp format_kind_reason(:error, %FunctionClauseError{} = struct, stack, _width, formatter) do {blamed, stack} = Exception.blame(:error, struct, stack) - - message = - error_info(Exception.format_banner(:error, struct), formatter) <> - pad(FunctionClauseError.blame(blamed, &inspect/1, &blame_match(&1, &2, formatter))) - + banner = Exception.format_banner(:error, struct) + blamed = FunctionClauseError.blame(blamed, &inspect/1, &blame_match(&1, &2, formatter)) + message = error_info(banner, formatter) <> "\n" <> pad(String.trim_leading(blamed, "\n")) {message, stack} end |