aboutsummaryrefslogtreecommitdiffstats
path: root/spec/core_storagemanager_spec.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-03-11 16:32:41 +0000
committerMatthew Wild <mwild1@gmail.com>2020-03-11 16:32:41 +0000
commitcb6148d155ea02a68e40b8afb5861451750499ad (patch)
tree02615b481f420a642185570584bfbedd0cb35a15 /spec/core_storagemanager_spec.lua
parent81f5c3e319792bec5d53c30334f3f54537aeb32b (diff)
downloadprosody-cb6148d155ea02a68e40b8afb5861451750499ad.tar.gz
prosody-cb6148d155ea02a68e40b8afb5861451750499ad.zip
storagemanager, mod_storage_sql: Rename methods to :get_all() and :delete_all()
Diffstat (limited to 'spec/core_storagemanager_spec.lua')
-rw-r--r--spec/core_storagemanager_spec.lua24
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/core_storagemanager_spec.lua b/spec/core_storagemanager_spec.lua
index 848f7910..b228c5fd 100644
--- a/spec/core_storagemanager_spec.lua
+++ b/spec/core_storagemanager_spec.lua
@@ -114,47 +114,47 @@ describe("storagemanager", function ()
end);
it("may find all users with a specific key", function ()
- assert.is_function(store.find_key);
+ assert.is_function(store.get_all);
assert(store:set("user9999b", "bar", "bar"));
assert(store:set("user9999c", "foo", "blah"));
- local ret, err = store:find_key("foo");
+ local ret, err = store:get_all("foo");
assert.is_nil(err);
assert.same({ user9999 = "bar", user9999c = "blah" }, ret);
end);
- it("rejects empty or non-string keys to find_key", function ()
- assert.is_function(store.find_key);
+ it("rejects empty or non-string keys to get_all", function ()
+ assert.is_function(store.get_all);
do
- local ret, err = store:find_key("");
+ local ret, err = store:get_all("");
assert.is_nil(ret);
assert.is_not_nil(err);
end
do
- local ret, err = store:find_key(true);
+ local ret, err = store:get_all(true);
assert.is_nil(ret);
assert.is_not_nil(err);
end
end);
- it("rejects empty or non-string keys to delete_key", function ()
- assert.is_function(store.delete_key);
+ it("rejects empty or non-string keys to delete_all", function ()
+ assert.is_function(store.delete_all);
do
- local ret, err = store:delete_key("");
+ local ret, err = store:delete_all("");
assert.is_nil(ret);
assert.is_not_nil(err);
end
do
- local ret, err = store:delete_key(true);
+ local ret, err = store:delete_all(true);
assert.is_nil(ret);
assert.is_not_nil(err);
end
end);
it("may delete all instances of a specific key", function ()
- assert.is_function(store.delete_key);
+ assert.is_function(store.delete_all);
assert(store:set("user9999b", "foo", "hello"));
- assert(store:delete_key("bar"));
+ assert(store:delete_all("bar"));
-- Ensure key was deleted
do
local ret, err = store:get("user9999b", "bar");