util.async: Add test to ensure waiters throw an error outside async contexts
authorMatthew Wild <mwild1@gmail.com>
Fri, 16 Mar 2018 22:19:33 +0000
changeset 8611 a2e6caf5848d
parent 8610 62bb06cf8a43
child 8612 9f6ab206d741
util.async: Add test to ensure waiters throw an error outside async contexts
spec/util_async_spec.lua
--- a/spec/util_async_spec.lua	Fri Mar 16 17:50:16 2018 +0000
+++ b/spec/util_async_spec.lua	Fri Mar 16 22:19:33 2018 +0000
@@ -84,6 +84,11 @@
 		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;