Skip to content

Commit 8154066

Browse files
author
José Valim
committed
Update CHANGELOG and verbage from previous pull request
1 parent a0a0694 commit 8154066

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
* bug fix
1818
* [ExUnit] Handle exit messages from in ExUnit
19+
* [ExUnit] Failures on ExUnit's setup_all now invalidates all tests
1920
* [Kernel] Ensure we don't splice keyword args unecessarily
2021
* [Kernel] Private functions used by private macros no longer emit an unused warning
2122
* [Kernel] Ensure Elixir won't trip on empty receive blocks

lib/ex_unit/lib/ex_unit/callbacks.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ defmodule ExUnit.Callbacks do
127127
## Helpers
128128

129129
def __merge__(_mod, other, :ok), do: other
130-
def __merge__(_mod, other, { :ok, data }), do: Keyword.merge(other, data)
130+
def __merge__(_mod, other, { :ok, data }) when is_list(data), do: Keyword.merge(other, data)
131131
def __merge__(mod, _, failure) do
132132
raise "expected ExUnit callback in #{inspect mod} to return :ok " <>
133133
" or { :ok, data }, got #{inspect failure} instead"

lib/ex_unit/lib/ex_unit/cli_formatter.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ defmodule ExUnit.CLIFormatter do
5353
super
5454
end
5555

56-
def handle_cast({ :test_finished, test = ExUnit.Test[failure: nil, invalid: true] }, config) do
56+
def handle_cast({ :test_finished, test = ExUnit.Test[invalid: true] }, config) do
5757
IO.write invalid("?")
5858
{ :noreply, config.update_counter(&1 + 1).
5959
update_test_failures([test|&1]) }
@@ -119,7 +119,7 @@ defmodule ExUnit.CLIFormatter do
119119
end
120120

121121
defp print_case_failure(ExUnit.TestCase[name: case_name, failure: { kind, reason, stacktrace }], acc, cwd) do
122-
IO.puts " #{acc}) #{inspect case_name}"
122+
IO.puts " #{acc}) #{inspect case_name}: failure on setup_all/teardown_all callback, tests invalidated."
123123
print_kind_reason(kind, reason)
124124
print_stacktrace(stacktrace, case_name, nil, cwd)
125125
IO.write "\n"

lib/ex_unit/lib/ex_unit/runner.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,14 @@ defmodule ExUnit.Runner do
8989
end
9090

9191
tests = tests_for(case_name)
92+
9293
if test_case.failure do
9394
Enum.each tests, fn test_name ->
9495
test = ExUnit.Test[name: test_name, case: test_case, invalid: true]
9596
pid <- { self, :test_finished, test }
9697
end
97-
self_pid <- { self, :case_finished, test_case }
9898

99+
self_pid <- { self, :case_finished, test_case }
99100
else
100101
Enum.each tests, run_test(config, pid, test_case, &1, context)
101102

0 commit comments

Comments
 (0)