Software /
code /
prosody
Diff
spec/util_promise_spec.lua @ 9511:cb88d729e98d
util.promise: Add additional test for promise.reject()
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 18 Oct 2018 12:04:14 +0100 |
parent | 9510:8ef46d09386a |
child | 9514:9db707a86a25 |
line wrap: on
line diff
--- a/spec/util_promise_spec.lua Thu Oct 18 12:03:33 2018 +0100 +++ b/spec/util_promise_spec.lua Thu Oct 18 12:04:14 2018 +0100 @@ -257,5 +257,11 @@ assert.spy(cb).was_called(1); assert.spy(cb).was_called_with("foo"); end); + it("returns a rejected promise and does not call on_fulfilled", function () + local p = promise.reject("foo"); + local cb = spy.new(function () end); + p:next(cb); + assert.spy(cb).was_called(0); + end); end); end);