File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,8 @@ defmodule ExUnit.DocTest do
197
197
e in [ ExUnit.ExpectationError ] ->
198
198
raise e , [ ] , unquote ( stack )
199
199
200
+ # If there was no exception among the tests, `exception` here will be
201
+ # nil and this clause won't match.
200
202
error in [ unquote ( exception ) ] ->
201
203
unless error . message == unquote ( message ) do
202
204
raise ExUnit.ExpectationError ,
@@ -213,6 +215,9 @@ defmodule ExUnit.DocTest do
213
215
[ prelude: "Expected doctest" ,
214
216
description: unquote ( whole_expr ) ,
215
217
expected: "#{ inspect unquote ( exception ) } " ,
218
+ # We're using a combined message here because all expressions
219
+ # (those that are expected to raise and those that aren't) are in
220
+ # the same try block above.
216
221
reason: "complete or raise" ,
217
222
actual: inspect ( error ) ] ,
218
223
unquote ( stack )
You can’t perform that action at this time.
0 commit comments