Liking cljdoc? Tell your friends :D

conjure.core

Simple mocking and stubbing for Clojure unit-tests. Supports Clojure 1.2 through 1.5.

Simple mocking and stubbing for Clojure unit-tests. Supports Clojure 1.2 through 1.5.
raw docstring

*in-fake-context*clj

Has a value of true when inside one of the Conjure faking macros. Used to give users helpful error messages.

Has a value of true when inside one of the Conjure faking macros.
Used to give users helpful error messages.
sourceraw docstring

assert-conjurified-fnclj

(assert-conjurified-fn macro-name fn-name)

Used internally by Conjure to make sure verify-x macros are only called on functions that have been used in mocking, stubbing, or instrumenting

Used internally by Conjure to make sure verify-x macros are only called on
functions that have been used in `mocking`, `stubbing`, or `instrumenting`
sourceraw docstring

assert-in-fake-contextclj

(assert-in-fake-context macro-name)

Used internally by Conjure to make sure verify-x macros ae only called from with Conjure's fakes

Used internally by Conjure to make sure `verify-x` macros ae only called from with Conjure's fakes
sourceraw docstring

call-timesclj

Atom holding a map of faked function names to the arglist that they were called with. This is used internally by Conjure.

Atom holding a map of faked function names to the arglist that they
were called with. This is used internally by Conjure.
sourceraw docstring

instrumented-fnclj

(instrumented-fn f)

Wraps a function, instrumenting it to record information about when it was called. The actual function is still called. This is used internally by Conjure.

Wraps a function, instrumenting it to record information about when it was
called. The actual function is still called.  This is used internally by Conjure.
sourceraw docstring

instrumentingcljmacro

(instrumenting fn-names & body)

Within the body of this macro you may use the various conjure verify-* macros to make assertions about how the mocked functions have been called. The original function is still called.

Within the body of this macro you may use the various conjure verify-* macros
to make assertions about how the mocked functions have been called.  The original
function is still called.
sourceraw docstring

mock-fnclj

(mock-fn function-name)

Wraps a function, instrumenting it to record information about when it was called, and stubbing it to return nil. This is used internally by Conjure.

Wraps a function, instrumenting it to record information about when it was
called, and stubbing it to return nil. This is used internally by Conjure.
sourceraw docstring

mockingcljmacro

(mocking fn-names & body)

Within the body of this macro you may use the various conjure verify-* macros to make assertions about how the mocked functions have been called. The original function is not actually called, instead a a return value of nil is produced and nothing is executed.

Within the body of this macro you may use the various conjure verify-* macros
to make assertions about how the mocked functions have been called.  The original
function is not actually called, instead a a return value of nil is produced and
nothing is executed.
sourceraw docstring

mocking-privatecljmacro

(mocking-private fn-names & body)

Allows using Conjure's mocking macro with private definitions.

It works by mocking public definitions and then using with-redefs to redefine the private ones.

Allows using Conjure's `mocking` macro with private definitions.

It works by mocking public definitions and then using `with-redefs` to redefine the private ones.
sourceraw docstring

stub-fnclj

(stub-fn f return-value)

Wraps a function, instrumenting it to record information about when it was called, and to return the return-value specified. The actual function is never called. This is used internally by Conjure.

Wraps a function, instrumenting it to record information about when it was
called, and to return the return-value specified.  The actual function is never called.
This is used internally by Conjure.
sourceraw docstring

stub-fn-with-return-valsclj

(stub-fn-with-return-vals & return-vals)

Creates a anonymous function that, on each successive call, returns the next item in the supplied return values. When it runs out of values to return, will continually return the rightmost supplied return value. Meant to be used on the righthand side of a stubbing macro's binding.

Creates a anonymous function that, on each successive call, returns the next
item in the supplied return values. When it runs out of values to return, will
continually return the rightmost supplied return value. Meant to be used on
the righthand side of a stubbing macro's binding.
sourceraw docstring

stubbingcljmacro

(stubbing stub-forms & body)

Within the body of this macro you may use the various conjure verify-* macros to make assertions about how the mocked functions have been called. This is like mocking, except you also specify the return value of the faked functions. If the return value is specified as a function, then that function will be used as the stub (it won't return the function - instead the function will be used in pace of the orginal.

Within the body of this macro you may use the various conjure verify-* macros
to make assertions about how the mocked functions have been called.  This is
like mocking, except you also specify the return value of the faked functions.
If the return value is specified as a function, then that function will be
used as the stub (it won't return the function - instead the function will be
used in pace of the orginal.
sourceraw docstring

stubbing-privatecljmacro

(stubbing-private bindings & body)

Allows using Conjure's stubbing macro with private definitions.

Allows using Conjure's `stubbing` macro with private definitions.
sourceraw docstring

verify-call-times-forcljmacro

(verify-call-times-for fn-name n)

Asserts that the faked function was called n times

Asserts that the faked function was called n times
sourceraw docstring

verify-called-once-with-argscljmacro

(verify-called-once-with-args fn-name & args)

Asserts that the faked function was called exactly once, and was passed the args specified

Asserts that the faked function was called exactly once, and was passed the
args specified
sourceraw docstring

verify-first-call-args-forcljmacro

(verify-first-call-args-for fn-name & args)

Asserts that the faked function was called at least once, and the first call was passed the args specified

Asserts that the faked function was called at least once, and the first call
was passed the args specified
sourceraw docstring

verify-first-call-args-for-indicescljmacro

(verify-first-call-args-for-indices fn-name indices & args)

Asserts that the function was called at least once, and the first call was passed the args specified, into the indices of the arglist specified. In other words, it checks only the particular args you care about.

Asserts that the function was called at least once, and the first call was
passed the args specified, into the indices of the arglist specified. In
other words, it checks only the particular args you care about.
sourceraw docstring

verify-nth-call-args-forcljmacro

(verify-nth-call-args-for n fn-name & args)

Asserts that the function was called n times, and the nth time was passed the args specified

Asserts that the function was called n times, and the nth time was passed the
args specified
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close