From 52b7181979bcee9000acf1c90e85934976e4da6a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 25 Nov 2019 20:52:01 +0100 Subject: util.stanza: Check that argument to error_reply is a stanza --- spec/util_stanza_spec.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/util_stanza_spec.lua') diff --git a/spec/util_stanza_spec.lua b/spec/util_stanza_spec.lua index 3b9084fa..23cdbeb9 100644 --- a/spec/util_stanza_spec.lua +++ b/spec/util_stanza_spec.lua @@ -214,6 +214,12 @@ describe("util.stanza", function() assert.are.equal(#r.tags, 1); assert.are.equal(r.tags[1].tags[1].name, "service-unavailable"); end); + + it("should reject not-stanzas", function () + assert.has.error_match(function () + st.error_reply(not "a stanza", "modify", "bad-request"); + end, "expected stanza"); + end); end); describe("should reject #invalid", function () -- cgit v1.2.3