From bb8066e59235c189625ad21558f40f95da0c3d75 Mon Sep 17 00:00:00 2001 From: Travis Vander Hoop Date: Wed, 5 Jun 2024 19:36:27 -0600 Subject: [PATCH] Address soft deprecation; prefer ExUnit.Case.register_test/6 - ExUnit.Case.register_test/6 has been available since Elixir 1.11.0, and now triggers deprecation warnings as of Elixir 1.17 --- lib/wallaby/feature.ex | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/wallaby/feature.ex b/lib/wallaby/feature.ex index 7d3e5ceb..5e3baf37 100644 --- a/lib/wallaby/feature.ex +++ b/lib/wallaby/feature.ex @@ -121,8 +121,17 @@ defmodule Wallaby.Feature do context = Macro.escape(context) contents = Macro.escape(contents, unquote: true) - quote bind_quoted: [context: context, contents: contents, message: message] do - name = ExUnit.Case.register_test(__ENV__, :feature, message, [:feature]) + %{module: mod, file: file, line: line} = __CALLER__ + + quote bind_quoted: [ + mod: mod, + file: file, + line: line, + context: context, + contents: contents, + message: message + ] do + name = ExUnit.Case.register_test(mod, file, line, :test, message, []) def unquote(name)(unquote(context)), do: unquote(contents) end