mirror of https://github.com/bjc/prosody
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
835 B
31 lines
835 B
local pubsub;
|
|
setup(function ()
|
|
pubsub = require "util.pubsub";
|
|
end);
|
|
|
|
describe("util.pubsub", function ()
|
|
describe("simple node creation and deletion", function ()
|
|
-- Roughly a port of scansion/scripts/pubsub_createdelete.scs
|
|
local service = pubsub.new();
|
|
|
|
describe("#create", function ()
|
|
it("creates a new node", function ()
|
|
assert.truthy(service:create("princely_musings", true));
|
|
end);
|
|
|
|
it("fails to create the same node again", function ()
|
|
assert.falsy(service:create("princely_musings", true));
|
|
end);
|
|
end);
|
|
|
|
describe("#delete", function ()
|
|
it("deletes the node", function ()
|
|
assert.truthy(service:delete("princely_musings", true));
|
|
end);
|
|
|
|
it("can't delete an already deleted node", function ()
|
|
assert.falsy(service:delete("princely_musings", true));
|
|
end);
|
|
end);
|
|
end);
|
|
end);
|
|
|