elixir-lang/elixir — pull request #704 by mururu (2012-12-08 05:20:56+00:00)
Title: The default formatter of ex_unit should not prints unneeded stacktraces.

The default formatter of ex_unit should not prints unneeded stacktraces.

The formatter prints stacktraces when tests fail.
And, Most of the stacktraces show inside of ex_unit module.
They are same all the time when test fail at assertions, in most cases, they are not needed.
So I modified the formatter to prints the filename and line number instead of the stacktrace when tests fails at assertion.

sample_test.exs
```
$ cat simple_test.exs
ExUnit.start
defmodule SampleTest do
use ExUnit.Case

test :fail do
assert false
end
end
```

before
```
$ elixir simple_test.exs
F

1) test_fail (SampleTest)
** (ExUnit.AssertionError) Expected false to be true
stacktrace:
/Users/yuki_ito/simple_test.exs:6: SampleTest.test_fail/0
/Users/yuki_ito/.exenv/versions/master/lib/ex_unit/lib/ex_unit/runner.ex:85: ExUnit.Runner.run_test/5
lists.erl:1262: :lists.foreach/2
/Users/yuki_ito/.exenv/versions/master/lib/elixir/lib/enum.ex:271: Enum.each/2
/Users/yuki_ito/.exenv/versions/master/lib/ex_unit/lib/ex_unit/runner.ex:71: ExUnit.Runner.run_tests/3

1 tests, 1 failures.
```
after
```
$ elixir simple_test.exs
F

1) test_fail (SampleTest)
** (ExUnit.AssertionError) Expected false to be true
at /Users/yuki_ito/simple_test.exs:6

1 tests, 1 failures.
```