aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-10-18 12:04:14 +0100
committerMatthew Wild <mwild1@gmail.com>2018-10-18 12:04:14 +0100
commitbd42adb56b30f4593fdec4c86e3ca18750b5e37d (patch)
treeb3cfea9b7edea3f7f3cca901eebc07a640f6f47d
parent08adc56f45fdebd59f7676cfeb788d09543e1c9e (diff)
downloadprosody-bd42adb56b30f4593fdec4c86e3ca18750b5e37d.tar.gz
prosody-bd42adb56b30f4593fdec4c86e3ca18750b5e37d.zip
util.promise: Add additional test for promise.reject()
-rw-r--r--spec/util_promise_spec.lua6
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);