aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_async_spec.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-03-16 22:19:33 +0000
committerMatthew Wild <mwild1@gmail.com>2018-03-16 22:19:33 +0000
commit05c0a961121bc9e04edb225f29c871adaeaf0ecf (patch)
tree5ca774b1ce40ca176db722675b77d7ad5d5104f1 /spec/util_async_spec.lua
parent364f1605a88bb07b52af85a6e02c75e1c5e02db2 (diff)
downloadprosody-05c0a961121bc9e04edb225f29c871adaeaf0ecf.tar.gz
prosody-05c0a961121bc9e04edb225f29c871adaeaf0ecf.zip
util.async: Add test to ensure waiters throw an error outside async contexts
Diffstat (limited to 'spec/util_async_spec.lua')
-rw-r--r--spec/util_async_spec.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/util_async_spec.lua b/spec/util_async_spec.lua
index 24f2efdb..67438595 100644
--- a/spec/util_async_spec.lua
+++ b/spec/util_async_spec.lua
@@ -84,6 +84,11 @@ describe("util.async", function()
end);
end);
describe("#waiter", function()
+ it("should error outside of async context", function ()
+ assert.has_error(function ()
+ async.waiter();
+ end);
+ end);
it("should work", function ()
local wait, done;