aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-01-08 16:21:05 +0100
committerKim Alvefur <zash@zash.se>2016-01-08 16:21:05 +0100
commitfb972a1ea95f574ecacd7a213a04c4cab5e41f56 (patch)
treeb72ea8b35e4dae603543a1b490f959f32b930870 /tests/test.lua
parent8502b7dc5d7169a43be5dd6fca14417ed39187a4 (diff)
parent9b4c1c40131ef343f5141242e134b18c45c2f128 (diff)
downloadprosody-fb972a1ea95f574ecacd7a213a04c4cab5e41f56.tar.gz
prosody-fb972a1ea95f574ecacd7a213a04c4cab5e41f56.zip
Merge 0.10->trunk
Diffstat (limited to 'tests/test.lua')
-rw-r--r--tests/test.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test.lua b/tests/test.lua
index 1666fcf5..1192b7b8 100644
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -140,9 +140,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);