summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMickael Remond <mremond@process-one.net>2016-03-31 17:34:50 +0200
committerMickael Remond <mremond@process-one.net>2016-03-31 17:34:58 +0200
commitef2e2e45b3169ba4bd68df5359b32f5e89239575 (patch)
treeb42651f65212066edd3ea536d335259b7b9ab4db /test
parentForce protobuffs version to be able to use new meck release (diff)
Fix failing tests
Diffstat (limited to 'test')
-rw-r--r--test/ejabberd_commands_test.exs5
-rw-r--r--test/elixir_SUITE.erl7
2 files changed, 5 insertions, 7 deletions
diff --git a/test/ejabberd_commands_test.exs b/test/ejabberd_commands_test.exs
index f415fee5..31d10821 100644
--- a/test/ejabberd_commands_test.exs
+++ b/test/ejabberd_commands_test.exs
@@ -27,6 +27,7 @@ defmodule EjabberdCommandsTest do
Record.defrecord :ejabberd_commands, Record.extract(:ejabberd_commands, from_lib: "ejabberd/include/ejabberd_commands.hrl")
setup_all do
+ :mnesia.start
:ejabberd_commands.init
end
@@ -38,7 +39,9 @@ defmodule EjabberdCommandsTest do
test "Check that admin commands are rejected with noauth credentials" do
:ok = :ejabberd_commands.register_commands([admin_test_command])
- {:error, :account_unprivileged} = :ejabberd_commands.execute_command(:undefined, :noauth, :test_admin, [])
+
+ assert catch_throw(:ejabberd_commands.execute_command(:undefined, :noauth, :test_admin, [])) == {:error, :account_unprivileged}
+
# Command executed from ejabberdctl passes anyway with access commands trick
# TODO: We should refactor to have explicit call when bypassing auth check for command-line
:ok = :ejabberd_commands.execute_command([], :noauth, :test_admin, [])
diff --git a/test/elixir_SUITE.erl b/test/elixir_SUITE.erl
index 7047d221..f92f750a 100644
--- a/test/elixir_SUITE.erl
+++ b/test/elixir_SUITE.erl
@@ -30,7 +30,7 @@ all() ->
case is_elixir_available() of
true ->
Dir = test_dir(),
- filelib:fold_files(Dir, ".*\.exs", false,
+ filelib:fold_files(Dir, ".*\.exs$", false,
fun(Filename, Acc) -> [list_to_atom(filename:basename(Filename)) | Acc] end,
[]);
false ->
@@ -69,11 +69,6 @@ run_elixir_test(Func) ->
%% Elixir tests can be tagged as follow to be ignored (place before test start)
%% @tag pending: true
'Elixir.ExUnit':start([{exclude, [{pending, true}]}]),
- filelib:fold_files(test_dir(), ".*\\.exs\$", true,
- fun (File, N) ->
- 'Elixir.Code':require_file(list_to_binary(File)),
- N+1
- end, 0),
'Elixir.Code':load_file(list_to_binary(filename:join(test_dir(), atom_to_list(Func)))),
%% I did not use map syntax, so that this file can still be build under R16
ResultMap = 'Elixir.ExUnit':run(),