aboutsummaryrefslogtreecommitdiffstats
path: root/spec/muc_util_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-11-05 22:31:25 +0100
committerKim Alvefur <zash@zash.se>2020-11-05 22:31:25 +0100
commit238b2bfc1cdb65ae7d051c2f29c1427149317795 (patch)
tree58547de6e7795740633c1b93e67c217eb621fe8f /spec/muc_util_spec.lua
parentce3e3808f5359f481f3ea063220ba71428b26ad5 (diff)
parent48521ba1538f797f5bef64f5fe5f3a9fb6e68f7f (diff)
downloadprosody-238b2bfc1cdb65ae7d051c2f29c1427149317795.tar.gz
prosody-238b2bfc1cdb65ae7d051c2f29c1427149317795.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 ()