aboutsummaryrefslogtreecommitdiffstats
path: root/spec/core_configmanager_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-08-11 19:59:19 +0200
committerKim Alvefur <zash@zash.se>2018-08-11 19:59:19 +0200
commit5894459e43449f78286f4812d1b188bbfd14cdf1 (patch)
tree89512ead9f5b84f1a65fcbc290a6cbb74cd8c4d9 /spec/core_configmanager_spec.lua
parent6098414f02eb0f51b13a2af76964b7d945b8a594 (diff)
downloadprosody-5894459e43449f78286f4812d1b188bbfd14cdf1.tar.gz
prosody-5894459e43449f78286f4812d1b188bbfd14cdf1.zip
spec: Correct order of arguments to asserts in configmanager tests
assert.foo(expect, got, ...)
Diffstat (limited to 'spec/core_configmanager_spec.lua')
-rw-r--r--spec/core_configmanager_spec.lua20
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/core_configmanager_spec.lua b/spec/core_configmanager_spec.lua
index b68d2756..afb7d492 100644
--- a/spec/core_configmanager_spec.lua
+++ b/spec/core_configmanager_spec.lua
@@ -5,27 +5,27 @@ describe("core.configmanager", function()
describe("#get()", function()
it("should work", function()
configmanager.set("example.com", "testkey", 123);
- assert.are.equal(configmanager.get("example.com", "testkey"), 123, "Retrieving a set key");
+ assert.are.equal(123, configmanager.get("example.com", "testkey"), "Retrieving a set key");
configmanager.set("*", "testkey1", 321);
- assert.are.equal(configmanager.get("*", "testkey1"), 321, "Retrieving a set global key");
- assert.are.equal(configmanager.get("example.com", "testkey1"), 321, "Retrieving a set key of undefined host, of which only a globally set one exists");
+ assert.are.equal(321, configmanager.get("*", "testkey1"), "Retrieving a set global key");
+ assert.are.equal(321, configmanager.get("example.com", "testkey1"), "Retrieving a set key of undefined host, of which only a globally set one exists");
configmanager.set("example.com", ""); -- Creates example.com host in config
- assert.are.equal(configmanager.get("example.com", "testkey1"), 321, "Retrieving a set key, of which only a globally set one exists");
+ assert.are.equal(321, configmanager.get("example.com", "testkey1"), "Retrieving a set key, of which only a globally set one exists");
- assert.are.equal(configmanager.get(), nil, "No parameters to get()");
- assert.are.equal(configmanager.get("undefined host"), nil, "Getting for undefined host");
- assert.are.equal(configmanager.get("undefined host", "undefined key"), nil, "Getting for undefined host & key");
+ assert.are.equal(nil, configmanager.get(), "No parameters to get()");
+ assert.are.equal(nil, configmanager.get("undefined host"), "Getting for undefined host");
+ assert.are.equal(nil, configmanager.get("undefined host", "undefined key"), "Getting for undefined host & key");
end);
end);
describe("#set()", function()
it("should work", function()
- assert.are.equal(configmanager.set("*"), false, "Set with no key");
+ assert.are.equal(false, configmanager.set("*"), "Set with no key");
- assert.are.equal(configmanager.set("*", "set_test", "testkey"), true, "Setting a nil global value");
- assert.are.equal(configmanager.set("*", "set_test", "testkey", 123), true, "Setting a global value");
+ assert.are.equal(true, configmanager.set("*", "set_test", "testkey"), "Setting a nil global value");
+ assert.are.equal(true, configmanager.set("*", "set_test", "testkey", 123), "Setting a global value");
end);
end);
end);