Skip to content

Commit

Permalink
fix: use ExUnit.Case.register_test/6
Browse files Browse the repository at this point in the history
ExUnit.Case.register_test/4 is deprecated since Elixir 1.12
  • Loading branch information
ahamez committed Jun 13, 2024
1 parent 34191fb commit 6138cd5
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions lib/properties.ex
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,16 @@ defmodule PropCheck.Properties do

# @tag failing_prop: tag_property({module, prop_name, []})
tags = [[failing_prop: tag_property({module, name, []})]]
prop_name = ExUnit.Case.register_test(__ENV__, :property, name, tags)

prop_name =
ExUnit.Case.register_test(
__ENV__.module,
__ENV__.file,
__ENV__.line,
:property,
name,
tags
)

def unquote(prop_name)(unquote(var)) do
{:ok, output_agent} = PropCheck.OutputAgent.start_link()
Expand Down Expand Up @@ -367,7 +376,15 @@ defmodule PropCheck.Properties do
"""
defmacro property(message) do
quote bind_quoted: [message: message] do
prop_name = ExUnit.Case.register_test(__ENV__, :property, message, [:not_implemented])
prop_name =
ExUnit.Case.register_test(
__ENV__.module,
__ENV__.file,
__ENV__.line,
:property,
message,
[:not_implemented]
)

def unquote(prop_name)(_) do
flunk("Not implemented")
Expand Down

0 comments on commit 6138cd5

Please sign in to comment.