Comparison

spec/util_async_spec.lua @ 8669:2aa85b0cd2b8

util.async: Use wrapper for once runner (thanks luacheck)
author Kim Alvefur <zash@zash.se>
date Thu, 22 Mar 2018 23:15:04 +0100
parent 8650:2f133b6e8740
child 8681:0c077800cd70
comparison
equal deleted inserted replaced
8668:31c5abd49dfe 8669:2aa85b0cd2b8
599 local f = spy.new(function () 599 local f = spy.new(function ()
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 assert.spy(f).was.called_with();
604 end); 605 end);
605 it("should propagate errors", function () 606 it("should propagate errors", function ()
606 local function should_error() 607 local function should_error()
607 async.once(function () 608 async.once(function ()
608 error("hello world"); 609 error("hello world");