Mocking.activateMethod
Mocking.activate()

Enable @mock call sites to allow for calling patches instead of the original function.

Mocking.anon_morespecificMethod
anon_morespecific(a::Method, b::Method) -> Bool

Determine which method is more specific for multiple dispatch without considering the function type. By not considering the function type we can determine which method is more specific as if they are a part of the same generic function.

Mocking.anonymous_signatureMethod
anonymous_signature(m::Method) -> Type{<:Tuple}

Construct a Tuple of the methods signature with the function type removed

Example

julia> m = first(methods(first, (String,)));

julia> m.sig
Tuple{typeof(first),Any}

julia> anonymous_signature(m)
Tuple{Any}
Mocking.deactivateMethod
Mocking.deactivate()

Disable @mock call sites to only call the original function.

Mocking.dispatchMethod
dispatch(funcs::AbstractVector, args...) -> Tuple{Method, Any}

Choose which method to execute based upon the provided arguments (values not types). Emulates Julia's multiple dispatch system but allows for dispatching between methods of multiple generic functions instead of just methods of a single generic function. Returns a tuple of the selected method and the generic function of the method.

When the function to dispatch to is ambiguous last ambiguous function in the vector is used.

Mocking.extract_kwargsMethod
extract_kwargs(expr::Expr) -> Vector{Union{Expr,Symbol}}

Extract the :parameters and :kw value into an array of :kw expressions we don't evaluate any expressions for values yet though.

Mocking.nullifyMethod
Mocking.nullify()

Force any packages loaded after this point to treat the @mock macro as a no-op. Doing so will maximize performance by eliminating any runtime checks taking place at the @mock call sites but will break any tests that require patches to be applied.

Note to ensure that all @mock macros are inoperative be sure to call this function before loading any packages which depend on Mocking.jl.