elixir-lang/elixir — pull request #2059 by ericmj (2014-02-17 22:44:19+00:00)
Title: Correctly report test setup errors and dont run tests in case of setup error

The following test case:
```elixir
defmodule Explex.APITest do
setup_all do
:ok = :error
end

test "foo" do
end
end
```

previously reported this error:
```
1) Explex.APITest: failure on setup_all/teardown_all callback, tests invalidated
** (RuntimeError) expected ExUnit callback in Explex.APITest to return :ok or { :ok, keywords }, got {:ok, nil} instead
stacktrace:
(ex_unit) lib/ex_unit/callbacks.ex:158: ExUnit.Callbacks.__merge__/3
```

now the following is reported:
```
1) Explex.APITest: failure on setup_all/teardown_all callback, tests invalidated
** (MatchError) no match of right hand side value: :error
stacktrace:
test/explex/api_test.exs:6: Explex.APITest.__ex_unit_setup_all_1/1
test/explex/api_test.exs:1: Explex.APITest.__ex_unit__/2
```

Additionally tests and teardowns are not run after a setup failure.