aboutsummaryrefslogtreecommitdiffstats
path: root/spec/muc_util_spec.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-09-30 09:50:33 +0100
committerMatthew Wild <mwild1@gmail.com>2020-09-30 09:50:33 +0100
commit785c20f6ee7e61a5a91a8b6259623bc2a2bbffaa (patch)
tree3a37db7b805b1555d08cc61c7938cf512ff35ce0 /spec/muc_util_spec.lua
parente55d037cdf89efac99c6144b381c9fa880f7fb93 (diff)
parentb80ff2ae4f86aa26e055890a8284b55170ef2056 (diff)
downloadprosody-785c20f6ee7e61a5a91a8b6259623bc2a2bbffaa.tar.gz
prosody-785c20f6ee7e61a5a91a8b6259623bc2a2bbffaa.zip
Merge 0.11->trunk
Diffstat (limited to 'spec/muc_util_spec.lua')
-rw-r--r--spec/muc_util_spec.lua22
1 files changed, 17 insertions, 5 deletions
diff --git a/spec/muc_util_spec.lua b/spec/muc_util_spec.lua
index cef68e80..3b2da4d0 100644
--- a/spec/muc_util_spec.lua
+++ b/spec/muc_util_spec.lua
@@ -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 ()