Open olfal opened 6 years ago
It would be nice to allow mocking/stubbing of private functions, for some particular use cases. The with-redefs function already allows this and a workaround is possible, but I'd rather not mix mocks and redefs.
with-redefs
Workaround :
(defn public-my-function []) (deftest each-statement-is-executed (mocking [public-my-function] (with-redefs [my-private-function public-my-function] (a-fonction-calling-my-private-function) (verify-call-times-for public-my-function 420))))
It would be nice to allow mocking/stubbing of private functions, for some particular use cases. The
with-redefs
function already allows this and a workaround is possible, but I'd rather not mix mocks and redefs.Workaround :