aboutsummaryrefslogtreecommitdiffstats
path: root/spec/core_storagemanager_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-05-11 21:41:02 +0200
committerKim Alvefur <zash@zash.se>2020-05-11 21:41:02 +0200
commitc3058505713cfbad76812f7797d52cc32e626fea (patch)
tree2bb49ffdc316cabfa34ef945e0cd64cc3a11f02d /spec/core_storagemanager_spec.lua
parent93b2288a078bff9f55b6c5b9eae57213f3a585f3 (diff)
downloadprosody-c3058505713cfbad76812f7797d52cc32e626fea.tar.gz
prosody-c3058505713cfbad76812f7797d52cc32e626fea.zip
spec/storage: Reset build context of test stanza make comparisons easier
While building a stanza there's a .last_add field keeping track of where in the XML tree tags are being added. This field does not survive a roundtrip through preserialize / deserialize. :reset() removes this, which simplifes comparisons after such a roundtrip.
Diffstat (limited to 'spec/core_storagemanager_spec.lua')
-rw-r--r--spec/core_storagemanager_spec.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/core_storagemanager_spec.lua b/spec/core_storagemanager_spec.lua
index b228c5fd..29ab014f 100644
--- a/spec/core_storagemanager_spec.lua
+++ b/spec/core_storagemanager_spec.lua
@@ -206,7 +206,8 @@ describe("storagemanager", function ()
local test_stanza = st.stanza("test", { xmlns = "urn:example:foo" })
:tag("foo"):up()
- :tag("foo"):up();
+ :tag("foo"):up()
+ :reset();
local test_time = 1539204123;
local test_data = {