From 44ae6bcc83f2a4f1e415f1b673527ab493b0219f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C3=85=C2=82=20Chmielowski?= Date: Fri, 21 Apr 2017 12:03:05 +0200 Subject: [PATCH] Fix elixir tests --- test/acl_test.exs | 1 + test/ejabberd_commands_mock_test.exs | 6 ++++-- test/ejabberd_commands_test.exs | 1 + test/ejabberd_cyrsasl_test.exs | 1 + test/mod_http_api_mock_test.exs | 1 + test/mod_http_api_test.exs | 1 + 6 files changed, 9 insertions(+), 2 deletions(-) diff --git a/test/acl_test.exs b/test/acl_test.exs index ada2d8fb1..0f8921f67 100644 --- a/test/acl_test.exs +++ b/test/acl_test.exs @@ -25,6 +25,7 @@ defmodule ACLTest do setup_all do :ok = :mnesia.start + :ejabberd_mnesia.start {:ok, _} = :jid.start :ejabberd_hooks.start_link :stringprep.start diff --git a/test/ejabberd_commands_mock_test.exs b/test/ejabberd_commands_mock_test.exs index 3a6874333..bb1dd636b 100644 --- a/test/ejabberd_commands_mock_test.exs +++ b/test/ejabberd_commands_mock_test.exs @@ -49,11 +49,13 @@ defmodule EjabberdCommandsMockTest do _ -> :ok end :mnesia.start + :ejabberd_mnesia.start {:ok, _} = :jid.start :ejabberd_hooks.start_link :ok = :ejabberd_config.start(["domain1", "domain2"], []) {:ok, _} = :ejabberd_access_permissions.start_link() {:ok, _} = :acl.start_link + :ejabberd_commands.start_link EjabberdOauthMock.init on_exit fn -> :meck.unload end end @@ -61,8 +63,8 @@ defmodule EjabberdCommandsMockTest do setup do :meck.unload :meck.new(@module, [:non_strict]) - :mnesia.delete_table(:ejabberd_commands) - :ejabberd_commands.start_link + :mnesia.clear_table(:ejabberd_commands) + :ejabberd_commands.register_commands(:ejabberd_commands.get_commands_spec()) :ok end diff --git a/test/ejabberd_commands_test.exs b/test/ejabberd_commands_test.exs index dff64b1ea..40e860c27 100644 --- a/test/ejabberd_commands_test.exs +++ b/test/ejabberd_commands_test.exs @@ -28,6 +28,7 @@ defmodule EjabberdCommandsTest do setup_all do :mnesia.start + :ejabberd_mnesia.start :stringprep.start :ok = :ejabberd_config.start(["localhost"], []) {:ok, _} = :ejabberd_access_permissions.start_link() diff --git a/test/ejabberd_cyrsasl_test.exs b/test/ejabberd_cyrsasl_test.exs index 1f190680d..4b066a5de 100644 --- a/test/ejabberd_cyrsasl_test.exs +++ b/test/ejabberd_cyrsasl_test.exs @@ -27,6 +27,7 @@ defmodule EjabberdCyrsaslTest do :ok = :ejabberd.start_app(:lager) :p1_sha.load_nif() :mnesia.start + :ejabberd_mnesia.start :ok = start_module(:stringprep) {:ok, _} = start_module(:jid) :ok = :ejabberd_config.start(["domain1"], []) diff --git a/test/mod_http_api_mock_test.exs b/test/mod_http_api_mock_test.exs index d7661ce4f..4dde78939 100644 --- a/test/mod_http_api_mock_test.exs +++ b/test/mod_http_api_mock_test.exs @@ -44,6 +44,7 @@ defmodule ModHttpApiMockTest do try do :jid.start :mnesia.start + :ejabberd_mnesia.start :stringprep.start :ejabberd_config.start([@domain], []) {:ok, _} = :ejabberd_access_permissions.start_link() diff --git a/test/mod_http_api_test.exs b/test/mod_http_api_test.exs index a9d05eafb..c39af79dc 100644 --- a/test/mod_http_api_test.exs +++ b/test/mod_http_api_test.exs @@ -29,6 +29,7 @@ defmodule ModHttpApiTest do setup_all do :ok = :mnesia.start + :ejabberd_mnesia.start :stringprep.start :ok = :ejabberd_config.start(["localhost"], []) {:ok, _} = :ejabberd_access_permissions.start_link() -- 2.40.0