Skip to content

Commit 53736de

Browse files
committed
Fix deprecation on Elixir v1.18
1 parent 9681ac2 commit 53736de

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

integration_test/support/file_helpers.exs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ defmodule Support.FileHelpers do
1313
tailored for this test case and test.
1414
"""
1515
defmacro in_tmp(fun) do
16-
path = Path.join([tmp_path(), "#{__CALLER__.module}", "#{elem(__CALLER__.function, 0)}"])
16+
{name, _arity} = __CALLER__.function || raise "in_tmp must be called inside a function"
17+
path = Path.join([tmp_path(), "#{__CALLER__.module}", "#{name}"])
18+
1719
quote do
1820
path = unquote(path)
1921
File.rm_rf!(path)
@@ -38,6 +40,6 @@ defmodule Support.FileHelpers do
3840
end
3941

4042
def assert_file(file, match) do
41-
assert_file file, &(assert &1 =~ match)
43+
assert_file(file, &assert(&1 =~ match))
4244
end
4345
end

0 commit comments

Comments
 (0)