midje

dbernal 2019-01-04T15:02:09.001200Z

is it possible to mock out and test macros? For example, let's say I would like to mock and test the or macro. Is this possible?

eraserhd 2019-01-04T15:17:20.002700Z

You can test a macro with eval. Otherwise it will have executed before your test runs.

eraserhd 2019-01-04T15:18:42.004300Z

I'm guessing mocking won't work, because if your code is in another namespace, it will have already expanded the macro by test time, and rebinding the macro won't cause it to re-expand.

eraserhd 2019-01-04T15:19:58.005200Z

You might be able to jury-rig something to reload the dependent namespace every time you rebind the macro, but that seems like it might be really flakey.

dbernal 2019-01-04T15:31:56.005900Z

I see ok thank you. I'm guessing another way would be to wrap the macro around a function and mock that