aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-09-28 23:48:02 +0200
committerKim Alvefur <zash@zash.se>2020-09-28 23:48:02 +0200
commit02b56f2304d65945480ecef156c5cf5c60b5ca9f (patch)
treef4309229137ee2a1e1c58b0f6e316222d0e0319e /spec
parent315d9ef8d9f43f0cc7929f98a6769f0567048e72 (diff)
downloadprosody-02b56f2304d65945480ecef156c5cf5c60b5ca9f.tar.gz
prosody-02b56f2304d65945480ecef156c5cf5c60b5ca9f.zip
util.error: Drop registry initialization with namespace as key
Enough complexity with compact vs normal and with/without namespace
Diffstat (limited to 'spec')
-rw-r--r--spec/util_error_spec.lua15
1 files changed, 4 insertions, 11 deletions
diff --git a/spec/util_error_spec.lua b/spec/util_error_spec.lua
index 8b995895..34edd313 100644
--- a/spec/util_error_spec.lua
+++ b/spec/util_error_spec.lua
@@ -96,8 +96,7 @@ describe("util.error", function ()
end);
it("compact mode works", function()
- local reg = errors.init("test", {
- namespace = "spec";
+ local reg = errors.init("test", "spec", {
broke = {"cancel"; "internal-server-error"; "It broke :("};
nope = {"auth"; "not-authorized"; "Can't let you do that Dave"; "sorry-dave"};
});
@@ -126,26 +125,20 @@ describe("util.error", function ()
extra = {namespace = "spec"; condition = "sorry-dave"};
};
});
- local compact1 = errors.init("test", {
- namespace = "spec";
- broke = {"cancel"; "internal-server-error"; "It broke :("};
- nope = {"auth"; "not-authorized"; "Can't let you do that Dave"; "sorry-dave"};
- });
- local compact2 = errors.init("test", "spec", {
+ local compact1 = errors.init("test", "spec", {
broke = {"cancel"; "internal-server-error"; "It broke :("};
nope = {"auth"; "not-authorized"; "Can't let you do that Dave"; "sorry-dave"};
});
- local compact3 = errors.init("test", {
+ local compact2 = errors.init("test", {
broke = {"cancel"; "internal-server-error"; "It broke :("};
nope = {"auth"; "not-authorized"; "Can't let you do that Dave"};
});
assert.same(normal.registry, compact1.registry);
- assert.same(normal.registry, compact2.registry);
assert.same({
broke = {type = "cancel"; condition = "internal-server-error"; text = "It broke :("};
nope = {type = "auth"; condition = "not-authorized"; text = "Can't let you do that Dave"};
- }, compact3.registry);
+ }, compact2.registry);
end);
end);