Midje存根方法不起作用

时间:2016-06-10 09:05:45

标签: clojure stubbing 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

有人可以帮我弄清楚我做错了什么吗?

1 个答案:

答案 0 :(得分:0)

问题出在project.clj文件中的这一行:

:jvm-opts ^:replace ["-Dclojure.compiler.direct-linking=true"]