From 53736de7e9be62d88b67aebebdb3c0f8e3b6e5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 6 Oct 2024 23:04:15 +0200 Subject: [PATCH] Fix deprecation on Elixir v1.18 --- integration_test/support/file_helpers.exs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/integration_test/support/file_helpers.exs b/integration_test/support/file_helpers.exs index 947ff494..72ba7419 100644 --- a/integration_test/support/file_helpers.exs +++ b/integration_test/support/file_helpers.exs @@ -13,7 +13,9 @@ defmodule Support.FileHelpers do tailored for this test case and test. """ defmacro in_tmp(fun) do - path = Path.join([tmp_path(), "#{__CALLER__.module}", "#{elem(__CALLER__.function, 0)}"]) + {name, _arity} = __CALLER__.function || raise "in_tmp must be called inside a function" + path = Path.join([tmp_path(), "#{__CALLER__.module}", "#{name}"]) + quote do path = unquote(path) File.rm_rf!(path) @@ -38,6 +40,6 @@ defmodule Support.FileHelpers do end def assert_file(file, match) do - assert_file file, &(assert &1 =~ match) + assert_file(file, &assert(&1 =~ match)) end end