diff options
author | Kim Alvefur <zash@zash.se> | 2016-01-08 16:21:05 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-01-08 16:21:05 +0100 |
commit | 8cdd08825d3ab4afddc12ddf75dc9af1924e8518 (patch) | |
tree | b72ea8b35e4dae603543a1b490f959f32b930870 /tests | |
parent | 3d0f3a9db092d06daa782135077acfaf9b40b69c (diff) | |
parent | b3d9c810676d288d193e4dcc3d95456e8a050f0e (diff) | |
download | prosody-8cdd08825d3ab4afddc12ddf75dc9af1924e8518.tar.gz prosody-8cdd08825d3ab4afddc12ddf75dc9af1924e8518.zip |
Merge 0.10->trunk
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test.lua | 7 |
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); |