Skip to content

Commit

Permalink
Properly raise for invalid async value
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Dec 28, 2024
1 parent 0cb79b0 commit 6dbb932
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ex_unit/lib/ex_unit/case.ex
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,10 @@ defmodule ExUnit.Case do
group = Keyword.get(opts, :group, nil)
parameterize = Keyword.get(opts, :parameterize, nil)

if not is_boolean(async?) do
raise ArgumentError, ":async must be a boolean, got: #{inspect(async?)}"
end

if not (parameterize == nil or (is_list(parameterize) and Enum.all?(parameterize, &is_map/1))) do
raise ArgumentError, ":parameterize must be a list of maps, got: #{inspect(parameterize)}"
end
Expand Down

0 comments on commit 6dbb932

Please sign in to comment.