I have written the following Midje test:
(fact (followers-minus-friends ...name...) => ["Dude"]
(provided (idset show-followers ...name...) => #{1 2 3}
(idset show-friends ...name...) => #{1 2}
(userinfos #{3}) => [{:screen_name "Dude"}]))
to test the following function (in a different namespace):
(defn followers-minus-friends [screenname]
(let [difference-ids (difference (idset show-followers screenname)
(idset show-friends screenname))
userinfos (userinfos difference-ids)]
(map :screen_name userinfos)))
The test may seem pretty useless, but I'm just trying to get accustomed to Midje. Somehow, the function idset just gets executed, which I wanted to prevent by providing a return value in the provided-clause. What could be an explanation for this?
EDIT: I have uploaded the project to Github here, in case you want to try to reproduce the above situation: https://github.com/Borkdude/twitter-utils