Diff

tests/test.lua @ 7061:eda0feeaf759

Merge 0.9->0.10
author Kim Alvefur <zash@zash.se>
date Fri, 08 Jan 2016 16:16:08 +0100
parent 7024:8ce592e376ff
parent 7051:ecfa474ff570
child 7062:90e8bbfbaabd
line wrap: on
line diff
--- a/tests/test.lua	Wed Jan 06 03:28:56 2016 +0100
+++ b/tests/test.lua	Fri Jan 08 16:16:08 2016 +0100
@@ -14,6 +14,7 @@
 	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 @@
 	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);