Diff

spec/util_promise_spec.lua @ 9510:8ef46d09386a

util.promise: Fix promise.reject() to return a rejected promise, and fix buggy test for it
author Matthew Wild <mwild1@gmail.com>
date Thu, 18 Oct 2018 12:03:33 +0100
parent 9457:d01cff2f7a26
child 9511:cb88d729e98d
line wrap: on
line diff
--- a/spec/util_promise_spec.lua	Thu Oct 18 00:49:29 2018 +0200
+++ b/spec/util_promise_spec.lua	Thu Oct 18 12:03:33 2018 +0100
@@ -253,7 +253,7 @@
 		it("returns a rejected promise", function ()
 			local p = promise.reject("foo");
 			local cb = spy.new(function () end);
-			p:next(cb);
+			p:catch(cb);
 			assert.spy(cb).was_called(1);
 			assert.spy(cb).was_called_with("foo");
 		end);