Consider the following code
(use 'midje.sweet)
(defn x2 [x] (* x x))
(def fs {:x2 x2})
(fact
(x2 1) => "one"
((:x2 fs) 1) => "one"
(against-background
(#'tweetfetcher.core-test/x2 1) => "one"))
which outputs
FAIL at (core_test.clj:177)
Expected: "one"
Actual: 1
FAILURE: 1 check failed. (But 32 succeeded.)
The first check is stubbed while the second use x2
as provided by the hashmap fs
.
Considering I rule out referencing, why is (:x2 fs)
not stubbed ?
Thanks for insights.