From 16d050ccd808a025da3586b4bac27313351331c6 Mon Sep 17 00:00:00 2001 From: Travis Vander Hoop Date: Wed, 5 Jun 2024 20:59:17 -0600 Subject: [PATCH] Address soft deprecation; prefer ExUnit.Case.register_test/6 (#776) --- 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..32a7bf65 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, :feature, message, [:feature]) def unquote(name)(unquote(context)), do: unquote(contents) end