[1] (provided (pilot-ready ["hello"]) =" /> [1] (provided (pilot-ready ["hello"]) =" /> [1] (provided (pilot-ready ["hello"]) ="/>

Midje stub method doesn't work

77 Views Asked by At

I'm trying to do this:

(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]))

What's this supposed to do, is stub the pilot ready method, and make it return [1] for the argument ["hello"]

The first fact fails with:

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

The second with:

FAIL at (innkeeper_paths_client_facts.clj:58)
    Expected: [1]
      Actual: [2]
       Diffs: in [0] expected 1, was 2
=> false

Can someone help me figure out what am I doing wrong?

1

There are 1 best solutions below

0
Danix On

The problem was this line, in the project.clj file:

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