0
我试图做到这一点:Midje存根方法不起作用
(defn pilot-ready [args] [2])
(defn ready []
(pilot-ready ["hello"]))
(facts
(ready) => [1]
(provided (pilot-ready ["hello"]) => [1]))
(against-background
[(pilot-ready ["hello"]) => [1]]
(fact
(ready) => [1]))
这是什么应该做的,是存根试点准备方法,并使其返回参数[” [1]你好“]
第一个事实失败:
FAIL at (innkeeper_paths_client_facts.clj:53)
These calls were not made the right number of times:
(pilot-ready ["hello"]) [expected at least once, actually never called]
FAIL at (innkeeper_paths_client_facts.clj:52)
Expected: [1]
Actual: [2]
Diffs: in [0] expected 1, was 2
=> false
第二带:
FAIL at (innkeeper_paths_client_facts.clj:58)
Expected: [1]
Actual: [2]
Diffs: in [0] expected 1, was 2
=> false
有人可以帮我弄清楚我做错了什么?
你的榜样为我工作。刚刚使用midje模板生成了一个项目,并将代码扔到那里。 – kongeor
确实如此,对于一个新生成的项目而言。现在我也为我的项目提供了一个解决方案。谢谢! – Danix