Skip to content

Conversation

@phmeier-nubank
Copy link

@phmeier-nubank phmeier-nubank commented Mar 7, 2024

This follows the suggestion in #10. Excerpt from the docs:

returning

If you want to return different values for each invocation, use mockfn.macros/returning.
Note that if the function will return nil afer all provided results are consumed.

(testing "providing - cause function non referential"
    (mfn/providing [(one-fn :argument-1) (mfn/returning :result-1 :result-2 )]
                   (is (= :result-1 (one-fn :argument-1)))
                   (is (= :result-2 (one-fn :argument-1)))
                   (is (nil? (one-fn :argument-1)))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants