Nothing Special   »   [go: up one dir, main page]

Skip to content
/ mockfn Public
forked from nubank/mockfn

A mocking library for Clojure.

License

Notifications You must be signed in to change notification settings

jqmtor/mockfn

 
 

Repository files navigation

mockfn

mockfn is a Clojure(script) library supporting mockist test-driven-development in Clojure. It is meant to be used alongside a regular testing framework such as clojure.test.

Clojars Project

Usage

The providing macro replaces a function with a configured mock.

(deftest providing-test
  (providing
    [(one-fn) :mocked]
    (is (= :mocked (one-fn)))))

The verifying macro works similarly, but also defines an expectation for the number of times a call should be performed during the test.

(deftest verifying-test
  (verifying
    [(one-fn) :mocked (at-least 1)]
    (is (= :mocked (one-fn)))))

Refer to the documentation for more detailed information, including:

License

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

A mocking library for Clojure.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Clojure 99.7%
  • Shell 0.3%