comparison spec/util_async_spec.lua @ 8650:2f133b6e8740

util.async: tests: ensure async.once() propagates errors
author Matthew Wild <mwild1@gmail.com>
date Thu, 22 Mar 2018 11:56:03 +0000
parents 9246f64d6f1e
children 2aa85b0cd2b8
comparison
equal deleted inserted replaced
8649:9246f64d6f1e 8650:2f133b6e8740
600 assert.truthy(async.ready()); 600 assert.truthy(async.ready());
601 end); 601 end);
602 async.once(f); 602 async.once(f);
603 assert.spy(f).was.called(); 603 assert.spy(f).was.called();
604 end); 604 end);
605 it("should propagate errors", function ()
606 local function should_error()
607 async.once(function ()
608 error("hello world");
609 end);
610 end;
611 assert.error_matches(should_error, "hello world");
612 end);
605 end); 613 end);
606 end); 614 end);