mirror of
https://github.com/bjc/prosody.git
synced 2025-04-01 20:27:39 +03:00
spec: Include a hacky moduleapi stub to allow test to proceed
This commit is contained in:
parent
9a93e48a90
commit
1f92aa9280
1 changed files with 17 additions and 5 deletions
|
@ -3,11 +3,23 @@ local muc_util;
|
|||
local st = require "util.stanza";
|
||||
|
||||
do
|
||||
local old_pp = package.path;
|
||||
package.path = "./?.lib.lua;"..package.path;
|
||||
muc_util = require "plugins.muc.util";
|
||||
package.path = old_pp;
|
||||
end
|
||||
-- XXX Hack for lack of a mock moduleapi
|
||||
local env = setmetatable({
|
||||
module = {
|
||||
_shared = {};
|
||||
-- Close enough to the real module:shared() for our purposes here
|
||||
shared = function (self, name)
|
||||
local t = self._shared[name];
|
||||
if t == nil then
|
||||
t = {};
|
||||
self._shared[name] = t;
|
||||
end
|
||||
return t;
|
||||
end;
|
||||
}
|
||||
}, { __index = _ENV or _G });
|
||||
muc_util = require "util.envload".envloadfile("plugins/muc/util.lib.lua", env)();
|
||||
end
|
||||
|
||||
describe("muc/util", function ()
|
||||
describe("filter_muc_x()", function ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue