summaryrefslogtreecommitdiff
path: root/test/test_helper.exs
diff options
context:
space:
mode:
authormarcin mikołajczak <git@mkljczk.pl>2023-12-22 13:29:56 +0100
committermarcin mikołajczak <git@mkljczk.pl>2023-12-22 13:29:56 +0100
commit28e5e65676ea08ae9e329d51648baf06dcf950c0 (patch)
treefd0b04e34a2f3df53b35ed5c3eb8301ad242ede6 /test/test_helper.exs
parent39d3df86c8e2ee05d409865ebc866c543a604ad9 (diff)
parent5f1d70736711275ac9f0c95e5ada4cb2f1a96e11 (diff)
downloadpleroma-28e5e65676ea08ae9e329d51648baf06dcf950c0.tar.gz
pleroma-28e5e65676ea08ae9e329d51648baf06dcf950c0.zip
Merge remote-tracking branch 'origin/develop' into webfinger-fix
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'test/test_helper.exs')
-rw-r--r--test/test_helper.exs16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/test_helper.exs b/test/test_helper.exs
index 7727cffbc..27b777d5f 100644
--- a/test/test_helper.exs
+++ b/test/test_helper.exs
@@ -4,8 +4,7 @@
Code.put_compiler_option(:warnings_as_errors, true)
-os_exclude = if :os.type() == {:unix, :darwin}, do: [skip_on_mac: true], else: []
-ExUnit.start(exclude: [:federated, :erratic] ++ os_exclude)
+ExUnit.start(exclude: [:federated, :erratic])
Ecto.Adapters.SQL.Sandbox.mode(Pleroma.Repo, :manual)
@@ -18,3 +17,16 @@ ExUnit.after_suite(fn _results ->
uploads = Pleroma.Config.get([Pleroma.Uploaders.Local, :uploads], "test/uploads")
File.rm_rf!(uploads)
end)
+
+defmodule Pleroma.Test.StaticConfig do
+ @moduledoc """
+ This module provides a Config that is completely static, built at startup time from the environment. It's safe to use in testing as it will not modify any state.
+ """
+
+ @behaviour Pleroma.Config.Getting
+ @config Application.get_all_env(:pleroma)
+
+ def get(path, default \\ nil) do
+ get_in(@config, path) || default
+ end
+end