midje

socksy 2017-09-07T14:07:19.000391Z

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

socksy 2017-09-07T14:08:05.000414Z

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

socksy 2017-09-07T14:08:09.000588Z

i would like to mock this out in the tests

socksy 2017-09-07T14:09:05.000322Z

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

socksy 2017-09-07T14:15:04.000196Z

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