Skip to content

Commit

Permalink
Address soft deprecation; prefer ExUnit.Case.register_test/6 (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanderhoop authored Jun 6, 2024
1 parent f9d3c35 commit 16d050c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/wallaby/feature.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 16d050c

Please sign in to comment.