Skip to content

Commit

Permalink
Fix deprecation on Elixir v1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Oct 6, 2024
1 parent 9681ac2 commit 53736de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions integration_test/support/file_helpers.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

0 comments on commit 53736de

Please sign in to comment.