util.async: tests: ensure async.once() propagates errors
authorMatthew Wild <mwild1@gmail.com>
Thu, 22 Mar 2018 11:56:03 +0000
changeset 8653 2f133b6e8740
parent 8652 9246f64d6f1e
child 8654 1b7c5933b215
util.async: tests: ensure async.once() propagates errors
spec/util_async_spec.lua
--- a/spec/util_async_spec.lua	Thu Mar 22 07:56:01 2018 +0000
+++ b/spec/util_async_spec.lua	Thu Mar 22 11:56:03 2018 +0000
@@ -602,5 +602,13 @@
 			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);