diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2021-01-19 00:23:39 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2021-01-19 00:23:39 +0300 |
commit | 318d6dde1c6cb0c3d6c9e31b976d71de8c721d8d (patch) | |
tree | 09aa683b6e966896d5fb5dd50d75c2d723308ded /test/support/data_case.ex | |
parent | 958a7f6ed071a5bfd0ea92c602fe0ee876c1e4c6 (diff) | |
download | pleroma-318d6dde1c6cb0c3d6c9e31b976d71de8c721d8d.tar.gz pleroma-318d6dde1c6cb0c3d6c9e31b976d71de8c721d8d.zip |
Mox mode setup tweak; refactoring.
Diffstat (limited to 'test/support/data_case.ex')
-rw-r--r-- | test/support/data_case.ex | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/support/data_case.ex b/test/support/data_case.ex index 9db3478bc..c309d2f41 100644 --- a/test/support/data_case.ex +++ b/test/support/data_case.ex @@ -62,7 +62,7 @@ defmodule Pleroma.DataCase do end) end - setup tags do + def setup_multi_process_mode(tags) do :ok = Ecto.Adapters.SQL.Sandbox.checkout(Pleroma.Repo) if tags[:async] do @@ -70,11 +70,16 @@ defmodule Pleroma.DataCase do Mox.set_mox_private() else Ecto.Adapters.SQL.Sandbox.mode(Pleroma.Repo, {:shared, self()}) - Mox.stub_with(Pleroma.CachexMock, Pleroma.CachexProxy) + Mox.set_mox_global() + Mox.stub_with(Pleroma.CachexMock, Pleroma.CachexProxy) clear_cachex() end + :ok + end + + def setup_streamer(tags) do if tags[:needs_streamer] do start_supervised(%{ id: Pleroma.Web.Streamer.registry(), @@ -83,6 +88,12 @@ defmodule Pleroma.DataCase do }) end + :ok + end + + setup tags do + setup_multi_process_mode(tags) + setup_streamer(tags) stub_pipeline() Mox.verify_on_exit!() |