我找不到任何在所有事实之后运行的 Midje 函数。
以下是代码:
(background
(before :contents (println "Before All Facts"))
(after :contents (println "After All Facts"))
(before :facts (println "Before Each Fact"))
(after :facts (println "After Each Fact")))
实际输出为:
Before All Facts
After All Facts
Before Each Fact
After Each Fact
预期输出为:
Before All Facts
Before Each Fact
After Each Fact
After All Facts
答案 0 :(得分:1)
您可以将所有事实包装在with-state-changes
中以实现此目的,但要注意Clojure对顶级表单的最大大小有限制。为避免此问题,您可以使用namespace-state-changes
在整个文件的开头和结尾执行设置和拆卸。