# HG changeset patch # User Matthew Wild # Date 1539860654 -3600 # Node ID cb88d729e98ddbe1180ca0bf105ea7fcd14bb6b2 # Parent 8ef46d09386a8dbb4b9f95cfa582bc31e389c667 util.promise: Add additional test for promise.reject() diff -r 8ef46d09386a -r cb88d729e98d spec/util_promise_spec.lua --- 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);