aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_async_spec.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-03-22 07:56:01 +0000
committerMatthew Wild <mwild1@gmail.com>2018-03-22 07:56:01 +0000
commitc600e0f6f60245d4c5ed9287fb5f2ccbdf06d8f1 (patch)
tree4f94912e6ab5403a1322045f6b9e55d5b59404dc /spec/util_async_spec.lua
parent430eef84208c1e4a0d07a2b32d76dccea731ca13 (diff)
downloadprosody-c600e0f6f60245d4c5ed9287fb5f2ccbdf06d8f1.tar.gz
prosody-c600e0f6f60245d4c5ed9287fb5f2ccbdf06d8f1.zip
util.async: Add once() to create temporary runners
Diffstat (limited to 'spec/util_async_spec.lua')
-rw-r--r--spec/util_async_spec.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/util_async_spec.lua b/spec/util_async_spec.lua
index ac71e755..f7e469c9 100644
--- a/spec/util_async_spec.lua
+++ b/spec/util_async_spec.lua
@@ -593,4 +593,14 @@ describe("util.async", function()
assert.spy(r.watchers.error).was_not.called();
end);
end);
+
+ describe("#once()", function ()
+ it("should work", function ()
+ local f = spy.new(function ()
+ assert.truthy(async.ready());
+ end);
+ async.once(f);
+ assert.spy(f).was.called();
+ end);
+ end);
end);