Fork me on GitHub
#midje
<
2017-09-07
>
socksy14:09:19

hey, i am having some troubles using midje to test some code i have

socksy14:09:05

i have ring middleware that rebinds a function (`fetch/get`) depending on stuff in the request map

socksy14:09:09

i would like to mock this out in the tests

socksy14:09:05

but (against-background (fetch/get "foo") => "bar") does not appear to work, and it goes ahead and does the middleware bound (fetch/get)

socksy14:09:04

i can't really follow what's going on in the midje source, so i guessed that maybe midje was rebinding (fetch/get) itself, so I added some metadata {:unassigned true} and only rebound fetch/get in my middleware when that was true. However, it still seems to have this metadata with (against-background) set, so I must have a faulty model in my mind of how midje is working here