aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-01-08 16:16:08 +0100
committerKim Alvefur <zash@zash.se>2016-01-08 16:16:08 +0100
commit6b1e54864c661211366d22a41435e5e3d07e71ac (patch)
treefa735fdc4d7fd7f7b8f14ea5dc1e5a86a0ca5dde /tests/test.lua
parent7baeaaa363aca2190c22f1bd4463ac52ab83bb99 (diff)
parentf9a3ca3602c72f24edecc95a886eace4edd42c5d (diff)
downloadprosody-6b1e54864c661211366d22a41435e5e3d07e71ac.tar.gz
prosody-6b1e54864c661211366d22a41435e5e3d07e71ac.zip
Merge 0.9->0.10
Diffstat (limited to 'tests/test.lua')
-rw-r--r--tests/test.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/test.lua b/tests/test.lua
index 1666fcf5..5d5851e1 100644
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -14,6 +14,7 @@ function run_all_tests()
dotest "util.multitable"
dotest "util.rfc6724"
dotest "util.http"
+ dotest "core.modulemanager"
dotest "core.stanza_router"
dotest "core.s2smanager"
dotest "core.configmanager"
@@ -140,9 +141,12 @@ function dotest(unitname)
end
local oldmodule, old_M = _fakeG.module, _fakeG._M;
- _fakeG.module = function () _M = unit end
+ _fakeG.module = function ()
+ setmetatable(unit, nil);
+ unit._M = unit;
+ end
setfenv(chunk, unit);
- local success, ret = pcall(chunk);
+ local success, err = pcall(chunk);
_fakeG.module, _fakeG._M = oldmodule, old_M;
if not success then
print("WARNING: ", "Failed to initialise module: "..unitname, err);