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