diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-10-18 12:04:14 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-10-18 12:04:14 +0100 |
commit | 0d3fa64b961586d70bbf9b9eb3e417687f6872d6 (patch) | |
tree | b3cfea9b7edea3f7f3cca901eebc07a640f6f47d /spec | |
parent | ef7d6ba99e768d0258840f7f261d2ea31eed07f0 (diff) | |
download | prosody-0d3fa64b961586d70bbf9b9eb3e417687f6872d6.tar.gz prosody-0d3fa64b961586d70bbf9b9eb3e417687f6872d6.zip |
util.promise: Add additional test for promise.reject()
Diffstat (limited to 'spec')
-rw-r--r-- | spec/util_promise_spec.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/util_promise_spec.lua b/spec/util_promise_spec.lua index ae3df29f..109c0a7b 100644 --- a/spec/util_promise_spec.lua +++ b/spec/util_promise_spec.lua @@ -257,5 +257,11 @@ describe("util.promise", function () 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); |