Software /
code /
prosody
Comparison
spec/core_configmanager_spec.lua @ 11200:bf8f2da84007
Merge 0.11->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 05 Nov 2020 22:31:25 +0100 |
parent | 10495:8ea685ec0979 |
comparison
equal
deleted
inserted
replaced
11199:6c7c50a4de32 | 11200:bf8f2da84007 |
---|---|
7 configmanager.set("example.com", "testkey", 123); | 7 configmanager.set("example.com", "testkey", 123); |
8 assert.are.equal(123, configmanager.get("example.com", "testkey"), "Retrieving a set key"); | 8 assert.are.equal(123, configmanager.get("example.com", "testkey"), "Retrieving a set key"); |
9 | 9 |
10 configmanager.set("*", "testkey1", 321); | 10 configmanager.set("*", "testkey1", 321); |
11 assert.are.equal(321, configmanager.get("*", "testkey1"), "Retrieving a set global key"); | 11 assert.are.equal(321, configmanager.get("*", "testkey1"), "Retrieving a set global key"); |
12 assert.are.equal(321, configmanager.get("example.com", "testkey1"), "Retrieving a set key of undefined host, of which only a globally set one exists"); | 12 assert.are.equal(321, configmanager.get("example.com", "testkey1"), |
13 "Retrieving a set key of undefined host, of which only a globally set one exists" | |
14 ); | |
13 | 15 |
14 configmanager.set("example.com", ""); -- Creates example.com host in config | 16 configmanager.set("example.com", ""); -- Creates example.com host in config |
15 assert.are.equal(321, configmanager.get("example.com", "testkey1"), "Retrieving a set key, of which only a globally set one exists"); | 17 assert.are.equal(321, configmanager.get("example.com", "testkey1"), "Retrieving a set key, of which only a globally set one exists"); |
16 | 18 |
17 assert.are.equal(nil, configmanager.get(), "No parameters to get()"); | 19 assert.are.equal(nil, configmanager.get(), "No parameters to get()"); |