aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_async_spec.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-03-22 11:56:03 +0000
committerMatthew Wild <mwild1@gmail.com>2018-03-22 11:56:03 +0000
commitcaab5a40c2db93af5d2edfdf426c918c26694886 (patch)
tree6347351b2b665b486d94dac84c6daa2b434ef0cf /spec/util_async_spec.lua
parentc600e0f6f60245d4c5ed9287fb5f2ccbdf06d8f1 (diff)
downloadprosody-caab5a40c2db93af5d2edfdf426c918c26694886.tar.gz
prosody-caab5a40c2db93af5d2edfdf426c918c26694886.zip
util.async: tests: ensure async.once() propagates errors
Diffstat (limited to 'spec/util_async_spec.lua')
-rw-r--r--spec/util_async_spec.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/util_async_spec.lua b/spec/util_async_spec.lua
index f7e469c9..7c1696b5 100644
--- a/spec/util_async_spec.lua
+++ b/spec/util_async_spec.lua
@@ -602,5 +602,13 @@ describe("util.async", function()
async.once(f);
assert.spy(f).was.called();
end);
+ it("should propagate errors", function ()
+ local function should_error()
+ async.once(function ()
+ error("hello world");
+ end);
+ end;
+ assert.error_matches(should_error, "hello world");
+ end);
end);
end);