diff --git a/test/fun_with_flags/supervisor_test.exs b/test/fun_with_flags/supervisor_test.exs index 6c490d74..fc755585 100644 --- a/test/fun_with_flags/supervisor_test.exs +++ b/test/fun_with_flags/supervisor_test.exs @@ -1,5 +1,6 @@ defmodule FunWithFlags.SupervisorTest do use FunWithFlags.TestCase, async: false + import FunWithFlags.TestUtils alias FunWithFlags.Config @@ -20,7 +21,7 @@ defmodule FunWithFlags.SupervisorTest do expected = { :ok, { - %{intensity: 3, period: 5, strategy: :one_for_one}, + expected_supervisor_spec(), [ %{ id: FunWithFlags.Store.Cache, @@ -63,7 +64,7 @@ defmodule FunWithFlags.SupervisorTest do expected = { :ok, { - %{intensity: 3, period: 5, strategy: :one_for_one}, + expected_supervisor_spec(), [ %{ id: FunWithFlags.Store.Cache, @@ -104,7 +105,7 @@ defmodule FunWithFlags.SupervisorTest do expected = { :ok, { - %{intensity: 3, period: 5, strategy: :one_for_one}, + expected_supervisor_spec(), [ %{ id: FunWithFlags.Store.Cache, @@ -150,7 +151,7 @@ defmodule FunWithFlags.SupervisorTest do expected = { :ok, { - %{intensity: 3, period: 5, strategy: :one_for_one}, + expected_supervisor_spec(), [ %{ id: Redix, @@ -179,7 +180,7 @@ defmodule FunWithFlags.SupervisorTest do expected = { :ok, { - %{intensity: 3, period: 5, strategy: :one_for_one}, + expected_supervisor_spec(), [ %{ id: Redix, @@ -208,7 +209,7 @@ defmodule FunWithFlags.SupervisorTest do expected = { :ok, { - %{intensity: 3, period: 5, strategy: :one_for_one}, + expected_supervisor_spec(), [] } } @@ -216,4 +217,12 @@ defmodule FunWithFlags.SupervisorTest do assert ^expected = FunWithFlags.Supervisor.init(nil) end end + + defp expected_supervisor_spec do + if on_elixir_15?() do + %{intensity: 3, period: 5, strategy: :one_for_one, auto_shutdown: :never} + else + %{intensity: 3, period: 5, strategy: :one_for_one} + end + end end diff --git a/test/support/test_utils.ex b/test/support/test_utils.ex index f58b4c5a..5e892435 100644 --- a/test/support/test_utils.ex +++ b/test/support/test_utils.ex @@ -83,4 +83,8 @@ defmodule FunWithFlags.TestUtils do def reset_app_env_to_default_redis_config do configure_redis_with([database: 5]) end + + def on_elixir_15? do + Version.match?(System.version, ">= 1.15.0") + end end