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
commitcdff82828c31d14b805213c68b8040ff2958d291 (patch)
tree6347351b2b665b486d94dac84c6daa2b434ef0cf /spec/util_async_spec.lua
parent38ac92b0df128fea95cb790f2920d747045598df (diff)
downloadprosody-cdff82828c31d14b805213c68b8040ff2958d291.tar.gz
prosody-cdff82828c31d14b805213c68b8040ff2958d291.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);