ClojureDocs

导航

命名空间

with-redefs-fn

clojure.core

从版本 1.3 起可用 (源代码)
  • (with-redefs-fn 绑定映射函数)
Temporarily redefines Vars during a call to func.  Each val of
binding-map will replace the root value of its key which must be
a Var.  After func is called with no args, the root values of all
the Vars will be set back to their old values.  These temporary
changes will be visible in all threads.  Useful for mocking out
functions during testing.