Skip to content

Commit 30f0b7f

Browse files
committed
Update assertions.ex
1 parent 8b353fd commit 30f0b7f

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

lib/assertions.ex

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@ defmodule Assertions do
261261
true
262262
263263
"""
264-
@spec assert_map_in_list(map, [map], [any]) :: true | no_return
265-
@spec assert_map_in_list(map, [map], comparison) :: true | no_return
264+
@spec assert_map_in_list(map, [map], nonempty_list(any)) :: true | no_return
266265
defmacro assert_map_in_list(map, list, keys_or_comparison) do
267266
assertion =
268267
assertion(
@@ -282,13 +281,6 @@ defmodule Assertions do
282281
keys = unquote(stringify_list(keys_or_comparison))
283282
message = "Map matching the values for keys `#{keys}` not found"
284283
{Enum.member?(list, map), map, list, message}
285-
else
286-
comparison = keys_or_comparison
287-
map = unquote(map)
288-
list = unquote(list)
289-
message = "Map not found in list using given comparison"
290-
291-
{Enum.any?(list, &comparison.(map, &1)), map, list, message}
292284
end
293285

294286
if in_list? do

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule Assertions.MixProject do
55
[
66
app: :assertions,
77
version: "0.19.0",
8-
elixir: "~> 1.7",
8+
elixir: "~> 1.14",
99
deps: deps(),
1010
description: description(),
1111
package: package(),

0 commit comments

Comments
 (0)